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

dataset handling #258

Open
UweOhse opened this issue Apr 17, 2024 · 1 comment
Open

dataset handling #258

UweOhse opened this issue Apr 17, 2024 · 1 comment

Comments

@UweOhse
Copy link

UweOhse commented Apr 17, 2024

I wanted to add a dataset to elements created with $.create, and got browser errors.
It's obviously not implemented, but i think it should be.
Would a patch implementing that be accepted?

       set: overload(function(property, value) {
                if (property in $.setProps) {
                        $.setProps[property].call(this, value);
                }
// new code
               else if (property === "dataset") {   /// or value instanceof DOMStringMap ?
                        for (const key of Object.keys(value)) {
                                this.dataset[key]=value[key]
                        }
                }
// end new
                else if (property in this) {
                       this[property] = value;
                }
                else {
                        this.setAttribute(property, value);
                }
        }, 0), 

As a side note: start/inside is a name combination i stumble upon all the time, so i did this in my regular startup:

Bliss.setProps.first=Bliss.setProps.start                                                                                                           
Bliss.setProps.last=Bliss.setProps.inside 
@LeaVerou
Copy link
Owner

Sure, feel free to send it! Though keep in mind Bliss v2 is where it's at, the Bliss v1 code is largely frozen. Bliss v2 is basically ready except the docs are not there, which is why it hasn't launched :/

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