LearnNewsExamplesServices
Frontmatter
id307
titlecomponent.Button: one combined dom listener
stateClosed
labels
enhancementstale
assignees[]
createdAtMar 17, 2020, 9:29 PM
updatedAtSep 28, 2024, 4:32 AM
githubUrlhttps://github.com/neomjs/neo/issues/307
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 28, 2024, 4:32 AM

component.Button: one combined dom listener

Closed v7.9.1/archive-v7-9-1-chunk-1 enhancementstale
tobiu
tobiu commented on Mar 17, 2020, 9:29 PM

pondering ticket.

right now, in case a handler config is set, one domListener => click will get added.

in case a route config is set, the same happens.

this is not too bad, since both use the global click listener on the document.body, but it does add another entry into manager.DomEvents (App worker).

To resolve this, a button should always add one (and only one) click listener, which points to a new method (e.g. onClick).

onClick needs to execute the route & handler, in case they exist.

the tricky part is, that controller.Component needs to get adjusted to parse and store the new handlerFn (since it is no longer related to the domEvent logic).

also, all existing code (examples, apps) needs to get checked and should replace all domListeners => click code with a handler.

tobiu added the enhancement label on Mar 17, 2020, 9:29 PM