bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.
https://bdlukaa.github.io/fluent_ui/
BSD 3-Clause "New" or "Revised" License
2.97k stars 464 forks source link

🐛 ListView => ListTile.selectable unexpected behaviour. #1144

Open DevMensIT opened 1 day ago

DevMensIT commented 1 day ago

Describe the bug when i hit enter its not getting to next focus but when i tried to select twice then it goes to next focus. i already use onSelectionChange to next focus but it calls when first i check then uncheck then check again (3x) after that focus on next tile

Expected behavior it suppose to work when i select inside listview then suppose to go focus next tile.

Screenshots

https://github.com/user-attachments/assets/0ffc388b-599b-4a3e-ac0f-6175bc02ba45

Code

 ListView.builder(
          itemCount: names.length,
          itemBuilder: (context, index) {
            final name = names[index];
            return ListTile.selectable(
              title: Text(name),
              onSelectionChange: (value) {
                if (value) FocusScope.of(context).nextFocus();
              },
              // selected: selectedNames == name,
              // onSelectionChange: (v) => setState(() => selectedNames = names),
            );
          });
bdlukaa commented 1 day ago

The "next focus" is the Checkbox. What happens when you call nextFocus() twice?

DevMensIT commented 1 day ago

The "next focus" is the Checkbox. What happens when you call nextFocus() twice?

its working well with twice call....

one more : when i use contentPadding : EdgeInsets.zero () but still showing padding much and even check box size property is missing or compact icon is missing