-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Embeddable Rebuild] [Controls] Fix control state on edit #188784
[Embeddable Rebuild] [Controls] Fix control state on edit #188784
Conversation
/ci |
Pinging @elastic/kibana-presentation (Team:Presentation) |
I don't think this issue is a bug or that that this issue needs to be resolved. The serializeState methods for the control types do not propagate keys from other control types. I think its ok for runtime state to maybe contain keys from other control types. A control type's |
@nreese Hmm... I am personally not a huge fan of having dirty state sticking around. This feels like a bigger risk of bugs to me than the current I will have to keep the change in |
examples/controls_example/public/react_controls/data_controls/types.ts
Outdated
Show resolved
Hide resolved
49b0f18
to
bb5cfb6
Compare
examples/controls_example/public/react_controls/data_controls/data_control_editor.test.tsx
Outdated
Show resolved
Hide resolved
examples/controls_example/public/react_controls/data_controls/data_control_editor.tsx
Outdated
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @Heenawter |
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.
LGTM
code review, tested in chrome
Summary
This PR fixes control editing so that, when the control type is changed, extra state from the old type gets removed. Prior to this, controls were keeping unrelated state - for example, switching from a range slider to a search control would result in a search control with the "step" property.
Checklist
For maintainers