WICG / inert

Polyfill for the inert attribute and property.
Other
924 stars 81 forks source link

watch for [data-inert] elements and turn them inerted as well (#126) #128

Open babielmam opened 5 years ago

babielmam commented 5 years ago

This allows to use the data-inert attribute to allow the polyfill and have valid HTML syntax. Related to #126

babielmam commented 5 years ago

@robdodson @alice please have a look at the PR I created. I also added some test, that I copied from the basic tests. I added a linebreak-style option to the ES-lint file because my IDE was otherwise reporting them as false. I think it shouldn't hurt to have it in there.

robdodson commented 5 years ago

Hey @babielmam, quick question: does this actually set data-inert on any of the elements?

babielmam commented 5 years ago

No, it doesn't set the data-inert attribute. As I looked over the code just right now, I see some cases where only inert is watched for but not data-inert. So, if you wish I can rework those parts

alice commented 5 years ago

Sorry for being so slow to get to this.

The code mostly looks good, but I'd like a couple more tests as suggested in my comment.

babielmam commented 5 years ago

@alice , @robdodson I reworked the parts mentioned in my last comment. I also added some more tests. Please take a look :)

robdodson commented 4 years ago

I think Alice is out of office till the 13th, but I'll see if she and I can catch up on this then.

bkardell commented 4 years ago

Just looking at it, it looks pretty good I, think. It seems just a little unfortunate to me that this has to be a thing, but it seems like a reasonable request and actual contribution.