neomjs / neo

The application worker driven frontend framework
https://neomjs.com
MIT License
2.89k stars 162 forks source link

component.Button: one combined dom listener #307

Closed tobiu closed 1 month ago

tobiu commented 4 years ago

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.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.