Skip to content

Conversation

@abhi3315
Copy link
Contributor

Description

The pill removal button isn't working because the addEventListener added to the remove button in tp-multi-select-pill is added in the constructor instead of connectedCallback. The constructor is called when the pill is created, but that instance doesn't include the remove button as a child. As a result, no addEventListener is attached to the pill remove button.

Solutions

I see two possible solutions:

  • Move the addEventListener code to the connectedCallback. But the other web components don't follow this and all the addEventListener are added directly to the constructor. To keep it consistent I followed the second approach
  • Attach the event listener to the button manually while creating the pill element.

@abhi3315 abhi3315 requested a review from junaidbhura May 22, 2024 19:05
@junaidbhura junaidbhura merged commit 4d3a23a into master May 22, 2024
@junaidbhura junaidbhura deleted the fix/multi-select-pill-close branch May 22, 2024 21:34
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

Successfully merging this pull request may close these issues.

2 participants