-
Notifications
You must be signed in to change notification settings - Fork 2.2k
calls transform function on constant attribute updates #9741
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
base: master
Are you sure you want to change the base?
Conversation
Fixes bugs that show up when inputting an accessor as a string instead of a function
@Pessimistress Could you take a look at this PR? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think I've hit this before. I think it primarily affects IconLayer
as having a static icon is a common pattern.
Could you add a test case toattribute.spec.ts
? 'standard accessor with transform'
could be used as a guide. Run tests with yarn test browser
@felixpalmer sorry to ping, but could you take a look again? |
You need to run yarn lint fix |
My bad, fixed it @felixpalmer |
The tests are still failing. Use ‘yarn test browser’ to run locally and try to debug&fix the issue |
Fixes bugs that show up when inputting an accessor as a string instead of a function.
Background
The bug can be seen clearly in this codepen: https://codepen.io/heebeegb/pen/RNWLyXB?editors=0010
Swapping the getIcon accessor to a function will make it work - this pull request calls the transform function for constant attributes as well, fixing the issue.
I changed the typing of "value" to any as the transform function has arbitrary inputs. Strings, numbers, and number arrays are all passed into setConstantValue already, this pipes them into the transform call if it exists.
Change List