slim-select icon indicating copy to clipboard operation
slim-select copied to clipboard

The change event triggered on the original select doesn't bubble

Open pepa-linha opened this issue 1 year ago • 2 comments

There was already an issue for bubbles created here

but in the current version the event is not with bubbles again:

https://github.com/brianvoe/slim-select/blob/master/src/slim-select/select.ts#L300

I supposed it should be

this.select.dispatchEvent(new Event('change'), { bubbles: true })

pepa-linha avatar Mar 08 '24 02:03 pepa-linha

I'm affected by this as well and have created #547 based on your suggestion. It does indeed fix it for me.

frenkel avatar May 22 '24 14:05 frenkel

I dont mind adding the pr I just need a test added for it.

brianvoe avatar May 22 '24 15:05 brianvoe

@brianvoe I'm trying to write tests for this and while doing so I found out that my original PR contained an error. Instead of this:

    this.select.dispatchEvent(new Event('change'), { bubbles: true })

it should have been:

    this.select.dispatchEvent(new Event('change', { bubbles: true }))

Sorry about that, I messed up in the Github web ui I guess.

Also, I don't think this fixes the case where a users selects an item. Can you help me find where the original change event is created for when a user selects an item? I'll then create a PR with tests for it.

frenkel avatar Jun 18 '24 07:06 frenkel

no worries. I made the fix for you

brianvoe avatar Jun 18 '24 12:06 brianvoe