jarek-foksa / xel

Xel - Widget toolkit for building native-like Electron and Web apps
https://xel-toolkit.org
Other
679 stars 58 forks source link

Route all x-doctabs tab switching to this.selectTab(tab). #70

Closed WetDesertRock closed 6 years ago

WetDesertRock commented 6 years ago

selectTab(tab) also fires the event. This will make it so any tab selection behavior sends an event (rather than just the pointer down).

The event was also modified to include the selected tab in the event detail.

This is also a useful external API to have.

I found that relying on the select event wasn't super reliable as it only fired in one circumstance. The other times where the tab could be selected weren't able to be captured through events.

jarek-foksa commented 6 years ago

Calling a DOM method should not trigger an UI event, this is a common pattern in HTML DOM. Those events are meant to be triggered only when user interacts with the UI.