Skip to content
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

🐛 The checkbox inside ListTile.selectable should not have its own focus #1144

Open
DevMensIT opened this issue Nov 22, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@DevMensIT
Copy link

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

2024-11-22.09-40-39.mp4

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
Copy link
Owner

bdlukaa commented Nov 22, 2024

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

@DevMensIT
Copy link
Author

DevMensIT commented Nov 22, 2024

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

@bdlukaa
Copy link
Owner

bdlukaa commented Nov 27, 2024

when i use contentPadding : EdgeInsets.zero ()
but still showing padding much

Vertically, a tile has a minimum height of kOneLineTileHeight - 40 pixels.

When checkbox is present (on multiple selection mode), it has a padding of 6 pixels on the left. This can not be changed because it matches the Windows UI values.

@DevMensIT
Copy link
Author

when i use contentPadding : EdgeInsets.zero ()
but still showing padding much

Vertically, a tile has a minimum height of kOneLineTileHeight - 40 pixels.

When checkbox is present (on multiple selection mode), it has a padding of 6 pixels on the left. This can not be changed because it matches the Windows UI values.

is there any way to play with checkbox padding and change size ?

@bdlukaa bdlukaa changed the title 🐛 ListView => ListTile.selectable unexpected behaviour. 🐛 The checkbox inside ListTile.selectable should not have its own focus Jan 30, 2025
@bdlukaa bdlukaa added the bug Something isn't working label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants