redox-os / orbtk

The Rust UI-Toolkit.
MIT License
3.77k stars 190 forks source link

Impossible to select the last tab after the previous last tab was closed #479

Closed AndersonDeMatos closed 2 years ago

AndersonDeMatos commented 2 years ago

When we close the last tab on the showcase example, it is impossible to select the tab that was just before that (it is the last tab now). For example, if there are 3 tabs and we close the third one, only two will remain (obviously), but we can't select the second one (now the last one) without first selecting the first tab. If there are only 2 tabs and we close the last tab, it will be impossible to see the contents of the remaining tab, it will be constantly inactive.

Steps to reproduce the behavior:

  1. Run the showcase example;
  2. Close the last tab;
  3. Try to click on the tab that is now the last one;

I noticed that when click on the close icon of an inactive tab, it gives that tab the focus before closing it. It would be good if we could close an inactive tab without changing focus first. If the last tab already has the focus when we click the close button, forcing the focus to change to the previous tab could solve the problem.

Desktop

rzerres commented 2 years ago

fixed. Will send a PR and merge.

rzerres commented 2 years ago

Bugfix merged.