This commit is contained in:
Hillel Coren 2019-10-03 21:49:11 +03:00
parent 79da0b0afc
commit c5c6150ffb
2 changed files with 11 additions and 1 deletions

View File

@ -136,7 +136,7 @@ class AppBuilderState extends State<AppBuilder> {
child: widget.builder(context),
focusNode: _focusNode,
onKey: (event) {
if (kReleaseMode) {
if (true || kReleaseMode) {
return;
}
print(

View File

@ -36,16 +36,24 @@ class EntityDropdown extends StatefulWidget {
class _EntityDropdownState extends State<EntityDropdown> {
final _textController = TextEditingController();
final _focusNode = FocusNode();
@override
void initState() {
super.initState();
_textController.text = widget.initialValue;
_focusNode.addListener(() {
print('## DOCUS EVENT: hasFocus: ${_focusNode.hasFocus}##');
if (_focusNode.hasFocus) {
_showOptions();
}
});
}
@override
void dispose() {
_textController.dispose();
_focusNode.dispose();
super.dispose();
}
@ -74,6 +82,8 @@ class _EntityDropdownState extends State<EntityDropdown> {
onTap: () => _showOptions(),
child: IgnorePointer(
child: TextFormField(
focusNode: _focusNode,
readOnly: true,
validator: widget.validator,
autovalidate: widget.autoValidate,
controller: _textController,