FTXUI icon indicating copy to clipboard operation
FTXUI copied to clipboard

Toggle not highlighting the selected option

Open mingsheng13 opened this issue 1 year ago • 2 comments

Toggle will always highlight the first option rather than the actually selected one. When the selected is the last option, right arrow key will not change the highlight to the last option and stuck to the first one instead.

mingsheng13 avatar Aug 13 '23 13:08 mingsheng13

Hi @mingsheng13, Thanks for opening an issue!

I can't really see any problems locally. Would you have some code example I could try to investigate?

ArthurSonzogni avatar Aug 13 '23 15:08 ArthurSonzogni

containerbug

I change the initial value of the selector in the example code. When I first run the code, the highlighted option is not the one that is selected.

To reproduce:

I changed https://github.com/ArthurSonzogni/FTXUI/blob/8d1665022a45352202904d9f47b3b30ef04d44eb/examples/component/toggle.cpp#L35C17-L38 to

  int toggle_1_selected = 0;
  int toggle_2_selected = 1;
  int toggle_3_selected = 0;
  int toggle_4_selected = 3;

mingsheng13 avatar Sep 10 '23 11:09 mingsheng13