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

How do I set "data-xxx" attributes on widgets? #716

Open
TreyBoudreau opened this issue Dec 4, 2021 · 1 comment
Open

How do I set "data-xxx" attributes on widgets? #716

TreyBoudreau opened this issue Dec 4, 2021 · 1 comment

Comments

@TreyBoudreau
Copy link

I'd like to set a data attribute on widgets, as per https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes

I've tried using create_element('div', {'data-my-prop': 'my value'}, ...) but something in Flexx seems to strip them out.

Any clues?

@almarklein
Copy link
Member

I wonder whether the way the attribute is set works:

ob[map.get(key, key)] = val

Could be that node.setAttribute is needed.

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

No branches or pull requests

2 participants