-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(android): fire selected
event again when clicking the same Tab again
#14094
Conversation
reselected
event on a Tab
This new event feels like bloat. I would think a "click" event with a current tab that you can check would suffice. |
This would work too (I would reuse the That was my only concern to move it to a different event. I'm more than happy with having only the |
android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java
Outdated
Show resolved
Hide resolved
Still not sure on this one. Feels unnessary. I don't get why we have a "selected" and "unselected" events either. On the web, we would have "click" and "change". It feels like there's too many events. |
I kind of agree, although the code itself is fine. What was the reason for adding this new API? Was someone unable to achieve this behavior with the current events? |
yes, I wanted to reset the data to the original state in my tab when I click the icon again and the was no event. We only have events when we change tabs. Clicking on the same doesn't trigger the My only concern was that it is a behavior change for existing apps if I just use Edit: I don't know if iOS triggers |
I would be fine with firing I would have to see how the UX is, but I could see how fat fingering a tab and reseting the state may be a bad UX pattern. I would think a "reset" button would be best, but I understand each app is different. |
e.g. in Slack, Whatsapp or Instagram it will scroll up to the first item if you click the Tab icon again which is a very handy use case. |
updated the example and code so it will just simply fire the |
reselected
event on a Tabselected
event again when clicking the same Tab again
If you reclick a tab it won't fire the event again. This PR will fire the
selected
event again if you click the tab againCan be used to reset/reload content in the tab if you click it again.
I didn't check yes how iOS
selected
behaves. Is that a one time event when you reclick the same tab?