Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lit-html] styleMap fails when update contains priority directive #3768

Merged
merged 2 commits into from Mar 29, 2023

Conversation

regevbr
Copy link
Contributor

@regevbr regevbr commented Mar 28, 2023

fix: #3767

Added test to verify that issue existed before, and fixed.

The fix is simple - remove the !important directive if exists, and set the priority argument in the call to setProperty

@changeset-bot
Copy link

changeset-bot bot commented Mar 28, 2023

🦋 Changeset detected

Latest commit: 2743734

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
lit-html Patch
lit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-cla
Copy link

google-cla bot commented Mar 28, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

packages/lit-html/src/directives/style-map.ts Outdated Show resolved Hide resolved
packages/lit-html/src/directives/style-map.ts Outdated Show resolved Hide resolved
packages/lit-html/src/directives/style-map.ts Outdated Show resolved Hide resolved
.changeset/popular-shoes-carry.md Outdated Show resolved Hide resolved
@regevbr
Copy link
Contributor Author

regevbr commented Mar 28, 2023

@justinfagnani not sure why, but some CI are failing with strange github errors. Have you seen that before?

https://github.com/lit/lit/actions/runs/4544819440
https://github.com/lit/lit/actions/runs/4544819448

Copy link
Collaborator

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@justinfagnani justinfagnani merged commit 7c1191d into lit:main Mar 29, 2023
7 checks passed
@regevbr regevbr deleted the styleMap branch March 29, 2023 02:10
@lit-robot lit-robot mentioned this pull request Apr 3, 2023
@dlockhart
Copy link

FYI, this change broke some stuff for us that was arguably incorrect but was working before nonetheless. The situation we had was something like this:

styleMap({
  'color': 'red',
  'aspect-ratio': 2.1
});

Obviously that Number should be a String, but this code was working but with this change it blows up on the .endsWith() call. Suggest maybe doing a type check or using an optional chain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[lit-html] styleMap fails when update contains priority directive
3 participants