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

QEditor - Plaintext pasting example editorRef.value.runCmd() - Not found #17158

Closed
cimpok opened this issue May 2, 2024 · 1 comment
Closed

Comments

@cimpok
Copy link

cimpok commented May 2, 2024

Description

editorRef.value.runCmd('insertText', text)
gives me the runtime error editorRef.value.runCmd is not a function

Workaround (after I looked at the editorRef.value object for almost an hour in vain, I showed the whole editorRef.value object from the devtools console (many screens long) to my programmer buddy ChatGPT, he came up with the workaround solution in 0.5 seconds: editorRef.value[0].runCmd('insertText', text)

this way it works Ok, but I still have no clue, why. My q-editor has the ref element applied directly, it is not in a container that has the ref.

Documentation Section URL

https://quasar.dev/vue-components/editor#plaintext-pasting

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

@cimpok
Copy link
Author

cimpok commented May 2, 2024

Sorry, my fault. My QEditor component was in a v-for block thats why there was an array of elements within the ref. It was not obvious for me ref works that way if many elements have the same ref.

@cimpok cimpok closed this as completed May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant