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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dom state cache #240

Merged
merged 4 commits into from
Jun 27, 2023
Merged

Dom state cache #240

merged 4 commits into from
Jun 27, 2023

Conversation

jachin
Copy link

@jachin jachin commented Jun 27, 2023

I've been seeing some bugs, where, as a much select changes, and moves from 1 configuration to another the configuration gets out of sync with the DOM.

For instance:

  • Turn on custom options
  • Switch to datalist output style
  • Switch back to custom html output style
  • 馃槩 custom options are no longer allowed

(I added a unit test, to test for this exact scenario, hopefully more unit tests like this one will help prevent us from breaking things like this in the future)

There's a few ways I could have solved this problem, but the one I thought would be the easiest to reason about would just be to keep a separate record that would just keep track of what the state of the light DOM is. Then in the logic for transitioning from one configuration to another we can bring in this DomStateCache record whenever we need to.

Hopefully this will allow for some progress to be made on #89

Right now this feature is only half baked. There will be more work to do to handle all the changes in the light DOM that we want to track.

Jachin Rupe added 4 commits June 23, 2023 17:12
I want to keep impossible state impossible, but for some of the Selection mode transitions I need to know what the current state of the DOM is.

We _could_ pass everything and kitchen sink in every time a DOM node changes but I think it would be more elegant to avoid that.
Moving and cleaning up a couple of other things.
@jachin jachin merged commit 87557f3 into master Jun 27, 2023
1 check passed
@jachin jachin deleted the dom-state-cache branch June 27, 2023 16:48
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.

None yet

1 participant