Skip to content

Commit

Permalink
fix: correct fields tab traverse (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Codeaview committed Aug 31, 2022
1 parent 33cb04a commit 51b6819
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions package/lib/src/core/lo_field.dart
Expand Up @@ -51,16 +51,16 @@ class _LoFieldState<TKey, TValue> extends State<LoField<TKey, TValue>> {
@override
Widget build(BuildContext context) {
final state = LoScope.of<TKey>(context);

return FocusScope(
child: Focus(
onFocusChange: (focus) => state.onFieldFocusChanged<TValue>(
widget.loKey,
focus,
),
child: widget.builder(
state.fields.get<TValue>(widget.loKey),
),
// Focus is needed to use onFocusChanged to mark fields as touched
return Focus(
// Ignore this Focus because LoFields already have their own
skipTraversal: true,
onFocusChange: (focus) => state.onFieldFocusChanged<TValue>(
widget.loKey,
focus,
),
child: widget.builder(
state.fields.get<TValue>(widget.loKey),
),
);
}
Expand Down

0 comments on commit 51b6819

Please sign in to comment.