Closed imshibl closed 3 months ago
Hi,
please do not add a GestureDetector into the item builder of the typeahead field. The typeahead field will already wrap your items with an InkWell that will call onSelected.
best regards.
Hey, Thanks for the response.
Yah i understand. However i added GestureDetector because onSelected is not invoking
On Fri, 16 Aug 2024 at 9:23 PM, clragon @.***> wrote:
Hi,
please do not add a GestureDetector into the item builder of the typeahead field. The typeahead field will already wrap your items with an InkWell that will call onSelected.
best regards.
— Reply to this email directly, view it on GitHub https://github.com/AbdulRahmanAlHamali/flutter_typeahead/issues/600#issuecomment-2293754683, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOG3D7UCZBV3MSQ75QMFYOLZRYN6XAVCNFSM6AAAAABMSAIFJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTG42TINRYGM . You are receiving this because you authored the thread.Message ID: @.***>
Ah, right. It's because your code contains a ListTile, which swallows all pointer events, even when it has no onTap itself. You can either add the onTap to the ListTile and call select yourself by grabbing the SuggestionsController from context, or you can use an IgnorePointer around your ListTile, which is easier, but prevents all taps. In case you have extra elements inside your ListTile that should not trigger a selection, then you must to the former.
Ok, thanks for the clarification.
On Fri, 16 Aug 2024 at 10:31 PM, clragon @.***> wrote:
Ah, right. It's because your code contains a ListTile, which swallows all pointer events, even when it has no onTap itself. You can either add the onTap to the ListTile and call select yourself by grabbing the SuggestionsController from context, or you can use an IgnorePointer around your ListTile, which is easier, but prevents all taps. In case you have extra elements inside your ListTile that should not trigger a selection, then you must to the former.
— Reply to this email directly, view it on GitHub https://github.com/AbdulRahmanAlHamali/flutter_typeahead/issues/600#issuecomment-2293851020, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOG3D7X5HMIKZABIEMOQUFTZRYV7DAVCNFSM6AAAAABMSAIFJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTHA2TCMBSGA . You are receiving this because you authored the thread.Message ID: @.***>
I confirm, version 5.2.0 ignores onSelect, with or without onTap, with or without adding a IgnorePointer as parent Widget. Rolling back to version 5.1.0 works as a charme.
Steps to reproduce
Expected results
This code is supposed to print the value to the debug console. but it's not working. so i have used a gesture detector in the itemBuilder,that's way its working.
Actual results
The onSelected function is not invoking when pressed on the suggestion values
Package Version
5.2.0
Platform
Android, iOS
Code sample
Code sample
```dart TypeAheadFieldLogs
Logs
```console [Paste your logs here] ```Screenshots or Video
Screenshots / Video demonstration
[Upload media here]