mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
fix input
This commit is contained in:
@@ -40,7 +40,7 @@ class KeyEventListenerState extends State<KeyEventListener> {
|
|||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
onKeyEvent: (node, event) {
|
onKeyEvent: (node, event) {
|
||||||
if (event is! KeyUpEvent) return KeyEventResult.handled;
|
if (event is! KeyUpEvent) return KeyEventResult.ignored;
|
||||||
if (event.logicalKey == LogicalKeyboardKey.escape) {
|
if (event.logicalKey == LogicalKeyboardKey.escape) {
|
||||||
if (App.rootNavigatorKey.currentState?.canPop() ?? false) {
|
if (App.rootNavigatorKey.currentState?.canPop() ?? false) {
|
||||||
App.rootNavigatorKey.currentState?.pop();
|
App.rootNavigatorKey.currentState?.pop();
|
||||||
@@ -52,7 +52,7 @@ class KeyEventListenerState extends State<KeyEventListener> {
|
|||||||
for (var handler in _handlers) {
|
for (var handler in _handlers) {
|
||||||
handler(event.logicalKey);
|
handler(event.logicalKey);
|
||||||
}
|
}
|
||||||
return KeyEventResult.handled;
|
return KeyEventResult.ignored;
|
||||||
},
|
},
|
||||||
child: widget.child,
|
child: widget.child,
|
||||||
);
|
);
|
||||||
|
@@ -33,8 +33,6 @@ class _SearchPageState extends State<SearchPage> {
|
|||||||
|
|
||||||
int searchType = 0;
|
int searchType = 0;
|
||||||
|
|
||||||
final focusNode = FocusNode();
|
|
||||||
|
|
||||||
static const searchTypes = [
|
static const searchTypes = [
|
||||||
"Search artwork",
|
"Search artwork",
|
||||||
"Search novel",
|
"Search novel",
|
||||||
@@ -102,8 +100,6 @@ class _SearchPageState extends State<SearchPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextBox(
|
child: TextBox(
|
||||||
focusNode: focusNode,
|
|
||||||
autofocus: false,
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
placeholder:
|
placeholder:
|
||||||
'${searchTypes[searchType].tl} / ${"Open link".tl}',
|
'${searchTypes[searchType].tl} / ${"Open link".tl}',
|
||||||
|
Reference in New Issue
Block a user