koukibadr / Bottom-Picker

https://pub.dev/packages/bottom_picker
MIT License
32 stars 21 forks source link

Keyboard on TextField not showing after tapping on picker, found using BottomPicker.dateTime #81

Open adessoli opened 10 months ago

adessoli commented 10 months ago

Hi,

I really enjoy using this package but it keeps having an issue in combination with TextField. First time entering the screen I can tap on the textfield and after tapping on the InkWell the picker appears. After closing the picker and tapping again on the textfield the keyboard opens and instantly closes again. From this moment the textfield can no longer be edited. I've already tried a lot with focus, controllers and so on. To me it turns out that its problem with your BottomPicker.

return Scaffold( body: SingleChildScrollView( child: Column( children: [ TextField( onTapOutside: (event) {}, key: GlobalKey(), controller: controller, maxLines: 3, keyboardType: TextInputType.multiline, ), InkWell( onTap: () => _openDateTimePicker(context), child: InputDecorator( decoration: InputDecoration( labelText: 'Voraussichtliches Ende', suffixIcon: Icon( Icons.date_range, color: primaryColor, size: 20.0, ), border: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0), ), ), child: Text( vm.expectedEndDateString, style: TextStyle(fontSize: 16, fontWeight: FontWeight.normal), ), ), ), ], ), ), );

Hope you have an idea.

koukibadr commented 9 months ago

@adessoli thanks for sending me your feedback and issue I'll check it out

KevinNizet commented 6 months ago

Hi @koukibadr @adessoli, adding readOnly and setting it to true in the TextField prevent the keyboard from opening after choosing an item from the bottom picker