Skip to content

Conversation

@karlseguin
Copy link
Collaborator

Uses the State to store the dataset, but, on first load, loads the data attributes from the DOM.

@krichprollsch
Copy link
Member

LGTM, but I'm wondering about attributes synchronization:

  • should be data-x attributes accessible from attributes list?
  • what about generating the html dump? if we don't sync with attr, we could loop hover the dataset to build the valid final html dump.

It's similar to our input problem I suppose. That's something we can work on in a future PR.

Uses the State to store the dataset, but, on first load, loads the data
attributes from the DOM.
@karlseguin karlseguin force-pushed the html_element_dataset branch from 1ca2052 to ec92f11 Compare June 25, 2025 04:16
@karlseguin
Copy link
Collaborator Author

LGTM, but I'm wondering about attributes synchronization:

You're right. I did a follow up commit. DataSet now just wraps the *parser.Element and uses elementGetAttribute, elementSetAttribute, elementRemoveAttribute.

I tested in browser, and this is more accurate to how it should work - changes to the dataset are reflected in the attributes and vice-versa.

@karlseguin karlseguin merged commit 9ea9859 into main Jun 26, 2025
11 checks passed
@karlseguin karlseguin deleted the html_element_dataset branch June 26, 2025 01:18
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants