8000 fix(initSpeech): scope click listener to one-off, namespaced handler to avoid external UI conflicts by amartincua · Pull Request #617 · ableplayer/ableplayer · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@amartincua
Copy link
Contributor
@amartincua amartincua commented May 9, 2025

The previous implementation used a global, persistent click listener, which in some environments (notably page builders like Elementor) interfered with other UI components such as popups or dropdowns.

Using .one() ensures the listener is automatically removed after the first click, reducing overhead and risk of side effects.

Adding an event namespace (.ableInitSpeech) makes the listener easier to manage and avoids conflicts with other click handlers.

…external UI events

The previous implementation used a global, persistent click listener, which in some environments (notably page builders like Elementor) interfered with other UI components such as popups or dropdowns.

Using .one() ensures the listener is automatically removed after the first click, reducing overhead and risk of side effects.

Adding an event namespace (.ableInitSpeech) makes the listener easier to manage and avoids conflicts with other click handlers.
@amartincua amartincua changed the title fix(initSpeech): namespace and single-shot click handler to preserve … fix(initSpeech): scope click listener to one-off, namespaced handler to avoid external UI conflicts May 9, 2025
Copy link
Contributor
@joedolson joedolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a typo, but otherwise I think this makes sense. Because this is an edit to the built file and a PR against main it's not mergeable, but I'll add props.

@joedolson
Copy link
Contributor

Fixed a typo, but otherwise I think this makes sense. Because this is an edit to the built file and a PR against main it's not mergeable, but I'll add props.

I should have read more closely; that wasn't a typo. Regardless, not mergeable because it's to a built file.

But shouldn't using .one() mean that the .off() unbind event isn't 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

Successfully merging this pull request may close these issues.

2 participants

0