Allow actions show-next-tab and previous to loop#5355
Allow actions show-next-tab and previous to loop#5355knolleary merged 2 commits intonode-red:masterfrom
Conversation
|
How do I go back to first tab without overshooting ? ( as the first tab loads first I put initialisation nodes on there ) |
|
I don't understand the question. If I have the following three tabs: A, B, and C. I'm on tab B (the active one), I click next, I'm on tab C. If I click next again, I'm back on tab A. If I click previous, I'm back on tab C... By click I mean trigger the action. |
|
If I have a bunch of tabs currently I can just click the left arrow a load of times without paying attention and know I will end up on the first one. With this fix I'll have to count exactly |
|
We can add |
I agree with Gogo that this is the proper solution! 🙏 |
knolleary
left a comment
There was a problem hiding this comment.
The findNext/PreviousVisibleTab utilities functions are used for more than just navigating. Having them wrap will cause unexpected behaviours elsewhere.
Instead of changing those functions, the wrapping logic should be done in activateNext/PreviousTab
Done 🙃 |
Types of changes
Proposed changes
Request: https://discourse.nodered.org/t/show-next-previous-tab-should-wrap/99696
Allow actions
show-next-tabandshow-previous-tabto loop; returns to the first tab if we have reached the end, and vice versa.Checklist
npm run testto verify the unit tests pass