Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[super_editor] Multiple carets showing up when multiple SuperEditors are used #738

Closed
MenuItem207 opened this issue Aug 15, 2022 · 2 comments
Labels
awaiting-customer-feedback Waiting for the customer to respond to us

Comments

@MenuItem207
Copy link

Placing multiple SuperEditors within the same page results in multiple carets appearing. Below is an example snippet:

void main() {
  runApp(
    MaterialApp(
      home: ListView(
        children: [
          SuperEditor(
            editor: DocumentEditor(
              document: MutableDocument(
                nodes: [
                  ParagraphNode(
                    id: DocumentEditor.createNodeId(),
                    text: AttributedText(text: 'Editor One'),
                  ),
                ],
              ),
            ),
          ),
          SuperEditor(
            editor: DocumentEditor(
              document: MutableDocument(
                nodes: [
                  ParagraphNode(
                    id: DocumentEditor.createNodeId(),
                    text: AttributedText(text: 'Editor Two'),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    ),
  );
}

Additionally, adding focus nodes to the SuperEditors and unfocussing them does not work:

void main() {
  FocusNode nodeOne = FocusNode();
  FocusNode nodeTwo = FocusNode();
  runApp(
    MaterialApp(
      home: Scaffold(
        floatingActionButton: Row(children: [
          FloatingActionButton(
              child: Text('unfocus all text'),
              onPressed: () {
                // unfocus both editors
                nodeOne.unfocus();
                nodeTwo.unfocus();
              })
        ]),
        body: ListView(
          children: [
            SuperEditor(
              focusNode: nodeOne,
              editor: DocumentEditor(
                document: MutableDocument(
                  nodes: [
                    ParagraphNode(
                      id: DocumentEditor.createNodeId(),
                      text: AttributedText(text: 'Editor One'),
                    ),
                  ],
                ),
              ),
            ),
            SuperEditor(
              focusNode: nodeTwo,
              editor: DocumentEditor(
                document: MutableDocument(
                  nodes: [
                    ParagraphNode(
                      id: DocumentEditor.createNodeId(),
                      text: AttributedText(text: 'Editor Two'),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    ),
  );
}
@matthew-carroll
Copy link
Contributor

@MenuItem207 can you confirm if this is still happening with the latest on main? We added some configurable policies that connect to editor focus to whether or not a selection is set.

@matthew-carroll matthew-carroll added the awaiting-customer-feedback Waiting for the customer to respond to us label Aug 29, 2023
@MenuItem207
Copy link
Author

Issue seems to be resolved. Thank you for your hard work!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-customer-feedback Waiting for the customer to respond to us
Projects
None yet
Development

No branches or pull requests

2 participants