Mobile first: Media query ordering issue
Question
- Are you using the latest release (older versions are NOT supported)? - 0.14.61
- Are you facing the bug with your local copy of GrapesJS or with the current demo? - I am facing the issue with both local and 'https://unpkg.com/grapesjs'
- The issue is mobile first media query ordering issue. With the current version media query ordering status is
@media (min-width: 1367px)
@media (min-width: 1024px)
@media (min-width: 320px)
- What is the expected behavior?
@media (min-width: 320px)
@media (min-width: 1024px)
@media (min-width: 1367px)
I tried to fix the sorting in the correct order.
sortMediaObject: function sortMediaObject() {
...
if (a.key.includes('min-width') && b.key.includes('min-width')) {
return _this4.getQueryLength(a.key) - _this4.getQueryLength(b.key);
} else {
return _this4.getQueryLength(b.key) - _this4.getQueryLength(a.key);
}
...
}
Is it a good solution? If so, please include this.
Answers (3)
Seems legit. I'll add it in the next release
Hello @artf @prosenjit-manna , Can you please help me that the feature is requested by @prosenjit-manna is implemented in the latest /*! grapesjs - 0.19.4 */ version ???
I have faced issues while mobile first approach CSS ordering is randomized.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2272
[BUG] `textable` component disappears with custom RTE
Are you using the latest release (older versions are NOT supported)? YesAre you facing the bug with your local copy of GrapesJS or with the...
Issue #2683
[BUG] When cancel Colorpicker, it set wrong value for component
Are you using the latest release (older versions are NOT supported)? Yes.Are you facing the bug with your local copy of GrapesJS or with th...
Issue #2722
[BUG] Highlight and toolbar positioned wrong on outside scroll
Are you using the latest release (older versions are NOT supported)? Yes Are you facing the bug with your local copy of GrapesJS or with th...
Issue #1941
[BUG]: When dragging a block over the canvas, JS in script, is appended in canvas before dropping the block.
You're submitting a BUG Are you using the latest release (older versions are NOT supported)? v0.14.57 Are you facing the bug with your loca...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.