Update auto focus function name

pull/1483/head
Ellet 2 years ago
parent 89be12a908
commit 3dad9e4490
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 4
      CHANGELOG.md
  2. 11
      lib/src/widgets/raw_editor/raw_editor.dart
  3. 2
      pubspec.yaml

@ -1,6 +1,6 @@
## [next]
## [8.0.1]
- Fixes a word typo of `mirgration` to `migration` in readme & migration document.
- Updated migration guide
## [8.0.0]
- If you have mirgrated recently, don't get scared from this update, it just add a documentation, mirgration guide and mark the version as more stable release, since we did break a lot of breaking changes (at least that what most developers says) we should have change the major version but when we were in the development of this new version, our time was very tight and now we are fixing the version number

@ -65,6 +65,7 @@ class RawEditor extends StatefulWidget {
required this.selectionColor,
required this.selectionCtrls,
required this.embedBuilder,
required this.autoFocus,
Key? key,
this.scrollable = true,
this.padding = EdgeInsets.zero,
@ -82,7 +83,6 @@ class RawEditor extends StatefulWidget {
this.customShortcuts,
this.customActions,
this.expands = false,
this.autoFocus = false,
this.enableUnfocusOnTapOutside = true,
this.keyboardAppearance = Brightness.light,
this.enableInteractiveSelection = true,
@ -1141,15 +1141,14 @@ class RawEditorState extends EditorState
_styles = _styles!.merge(widget.customStyles!);
}
// TODO: this might need some attention
_requestFocusIfShould();
_requestAutoFocusIfShould();
}
Future<void> _requestFocusIfShould() async {
Future<void> _requestAutoFocusIfShould() async {
if (!_didAutoFocus && widget.autoFocus) {
_didAutoFocus = true;
await Future.delayed(Duration.zero);
await Future.delayed(Duration.zero); // To avoid exceptions
FocusScope.of(context).autofocus(widget.focusNode);
_didAutoFocus = true;
}
}

@ -1,6 +1,6 @@
name: flutter_quill
description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter.
version: 8.0.0
version: 8.0.1
homepage: https://1o24bbs.com/c/bulletjournal/108
repository: https://github.com/singerdmx/flutter-quill
topics:

Loading…
Cancel
Save