Cannot set property "grid-column-start" using .css() #4007
Comments
|
Thanks for the report (and a test case!). This is because, unfortunately, jQuery adds the We keep a blacklist of CSS properties that shouldn't be getting this treatment: Lines 219 to 233 in 775caeb We'll need to add Grid properties with number values there. Would you like to submit a PR to add this value (and perhaps more Grid-related ones)? Before a fixed jQuery version arrives you can workaround this locally by: jQuery.cssNumber.gridColumnStart = true;See a fixed JSFiddle: https://jsfiddle.net/j15q5tzg/42/ |
|
BTW, there's also a more obvious workaround - if you pass the string |
|
Ah, I suspected something along those lines. Thank you for the detailed explanation and multiple workarounds! Am I supposed to close this issue or is that what someone else should be doing? |
|
I can submit a pull request sometime this week I think. (I think that's what you mean by PR?) |
|
Yes, I meant “pull request”, we often shorten it to PR.
There’s no hurry so next week is totally fine! Let us know if you can’t
find time or if you have any questions about how to submit a PR for this
issue. We’ll happily guide you through the contribution process.
Thanks!
--
Michał Gołębiowski-Owczarek
|
|
(And let’s keep this issue open until it’s fixed)
--
Michał Gołębiowski-Owczarek
|
|
I finally got around to compiling the CSS grid properties that need to be added. I'm not sure if I need to update the unit test. The current unit test doesn't seem to have any specific cases for any of the current list of special-case CSS properties. Lines 208 to 272 in 73d7e62 |
|
@enbo Could you submit a PR with your changes so that we can discuss them there? The list looks good at first sight. As for the tests, we do have a few of assertions, see: Lines 1120 to 1144 in 73d7e62 You could add the grid ones to the test. You'll need to check for grid support first, similarly to how animation-iteration-count is treated. I think you may just check if $div.css( "display", "grid" ) is set properly and put all the assertions inside this if's then block.
|
|
You accidentally closed it from a PR to your fork. :) Reopening. |
This commit adds some CSS grid-related properties to jQuery.cssNumber. Fixes gh-4007
Description
$(selector).css("grid-column-start", value);fails to add an inline style to the element.I believe there are other grid properties that have the same problem.
Link to test case
JSFiddle
The text was updated successfully, but these errors were encountered: