You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When style.setProperty is given null or '', the browser effectively clears the value (at least for css custom properties). However, when passed undefined, the browser serializes undefined to the string"undefined" 😢 . This PR modifies our setStyle function to handle undefined and convert it to an empty string in this case.
Quick gut check: Is this something we want to support in core or put in compat? It's a fairly small change, but does fall into one of those changes where we are diverging from browser behavior so just wanted to check if that's something we want to put in core.
Gonna keep this in core since we already coerce undefined and null to empty string when setting style properties. This change makes our usage of setProperty aligned to what we do for style properties.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
style.setProperty
is givennull
or''
, the browser effectively clears the value (at least for css custom properties). However, when passedundefined
, the browser serializesundefined
to the string"undefined"
😢 . This PR modifies oursetStyle
function to handle undefined and convert it to an empty string in this case.Quick gut check: Is this something we want to support in core or put in compat? It's a fairly small change, but does fall into one of those changes where we are diverging from browser behavior so just wanted to check if that's something we want to put in core.
Fixes #3861