mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-25 15:17:28 -04:00
feat: support click to create content inside empty toggle list (#6854)
* feat: support click to create content inside empty toggle list * test: support click to create content inside empty toggle list * fix: toggle list rtl issue * chore: optimize cover title request node logic
This commit is contained in:
parent
2ad2a79bd0
commit
bde1457524
5 changed files with 135 additions and 34 deletions
|
@ -163,7 +163,11 @@ class _DocumentPageState extends State<DocumentPage>
|
|||
return Provider(
|
||||
create: (_) {
|
||||
final context = SharedEditorContext();
|
||||
if (widget.view.name.isEmpty) {
|
||||
final children = editorState.document.root.children;
|
||||
final firstDelta = children.firstOrNull?.delta;
|
||||
final isEmptyDocument =
|
||||
children.length == 1 && (firstDelta == null || firstDelta.isEmpty);
|
||||
if (widget.view.name.isEmpty && isEmptyDocument) {
|
||||
context.requestCoverTitleFocus = true;
|
||||
}
|
||||
return context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue