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

[Documentation]: Commands #4137

Closed
wallace-yang opened this issue Jun 18, 2023 · 3 comments · Fixed by #4138
Closed

[Documentation]: Commands #4137

wallace-yang opened this issue Jun 18, 2023 · 3 comments · Fixed by #4138
Assignees
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Documentation The issue or pullrequest is related to documentation

Comments

@wallace-yang
Copy link

What’s the URL to the page you’re sending feedback for?

https://tiptap.dev/experiments/commands

What part of the documentation needs improvement?

This example has a problem with using the Chinese input method. When I use the Chinese input method, onStart in the suggestion.js file is executed, but there is no props.clientRect property.

Although this case is already filtered using “if(props.clientRect)”, it should be filtered on the first line of the function, otherwise it will cause rendering-related errors。

The problem I encountered was that I used the element-plus infinite-scroll component in the CommandsList.vue file. When I entered the full active string in Chinese, no menu appeared. When I moved the cursor one bit to the left, an error occurred.

Cannot destructure property 'container' of 'el[SCOPE]' as it is undefined.

please move this part to the first line of onStart function!!!
if (!props.clientRect) { return }

What is helpful about that part?

Reduce bugs risk for Chinese users

What is hard to understand, missing or misleading?

if (!props.clientRect) { return }
should run at the first line of onStart Function!!!

Anything to add? (optional)

No response

@wallace-yang wallace-yang added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Documentation The issue or pullrequest is related to documentation labels Jun 18, 2023
@hariacharya80
Copy link
Contributor

    return {
      onStart: props => {
         if (!props.clientRect) {
          return
        }

        reactRenderer = new ReactRenderer(MentionList, {
          props,
          editor: props.editor,
        })

is this what we are looking for ? @wallace-yang

@wallace-yang
Copy link
Author

    return {
      onStart: props => {
         if (!props.clientRect) {
          return
        }

        reactRenderer = new ReactRenderer(MentionList, {
          props,
          editor: props.editor,
        })

is this what we are looking for ? @wallace-yang
yes! that's right!

@hariacharya80
Copy link
Contributor

Oh, ok @wallace-yang shall I open a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Documentation The issue or pullrequest is related to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants