- Issue created by @chizh273
- Status changed to Needs review
11 months ago 3:47pm 2 June 2024 - πΊπ¦Ukraine chizh273
I have added field to the "Exposed form options" form for media query and added checking this media query before triggering the submit button. Could someone review these changes, pls?
- Issue was unassigned.
- Status changed to RTBC
11 months ago 9:26am 3 June 2024 - Status changed to Needs work
11 months ago 12:06pm 3 June 2024 - πΊπΈUnited States smustgrave
Will need an upgrade path and schema validation most likely
- πΊπΈUnited States smustgrave
So for this one I don't think we should assume site builders know how to write media queries. Instead maybe the field should be a number field that sets up the media query.
- πΊπ¦Ukraine chizh273
We can use the
breakpoint
core module instead of the media query string. In this case, all breakpoints will be defined in the yml files, and the site builders will choose which one they want to use in the select list. - Merge request !156Issue #3452004 by chizh273: Disable autosubmit with breakpoint. β (Open) created by chizh273
- πΊπ¦Ukraine chizh273
I have implemented the breakpoint approach in the
3452004--disable-autosubmit-with-7x
branch. - πΊπΈUnited States smustgrave
Thanks, will probably need an upgrade hook for the new key
- π©πͺGermany yannickoo Berlin
Hey I just checked the implementation in the MR and I am not sure if we want to rely on the breakpoints that are defined in the YAML file. What would you think about using a JS condition for this, e.g.
if ('ontouchstart' in window)
- πΊπ¦Ukraine chizh273
chizh273 β changed the visibility of the branch 7.1.x to hidden.
- πΊπ¦Ukraine chizh273
chizh273 β changed the visibility of the branch 3452004--disable-autosubmit-with-7-1-x to hidden.
- πΊπ¦Ukraine chizh273
The merge conflict is resolved.
I'd say that we don't need an upgrade hook for the new key because these changes shouldn't affect any existing configurations. We have a whether breakpoint is not empty check, and the default value is an empty string, so existing configurations will skip the breakpoint part till it's configured.
I don't think it will work as expected, as `ontouchstart` can be emitted on laptops with a touchscreen. Also, it wouldn't give us as much flexibility as breakpoints. For example, you have views with filters, which are hidden in a modal on mobile and tablet vertical orientation, but they are visible on tablet horizontal orientation and desktop. This means that filters shouldn't be auto-submitted when they are in modal, but they should be when they are visible on the page. So, from my point of view, the best way to implement it is with breakpoints, as you'd have a lot of flexibility and would reuse existing breakpoints from your theme.
- πΊπΈUnited States smustgrave
New keys should have an upgrade hook, if the key isnβt appearing then something seems wrong