Closed jb-alvarado closed 4 months ago
So I'm guessing the problem here is the value of editor.isActive('bold')
is flickering when you click on input (EditorContent).
I'll soon try it be myself and test it. Just not getting enough time.
Thanks @modbender for your quick response! But when I remove all :class="{ 'btn-accent': editor.isActive('...') }"
the problem still exists. I don't know if you see it in the screen record, but when I click on a selected word, the selection become bold. When my buttons start not with the bold button, but with the italic, then the clicking on a selection makes the selection italic.
I wonder why clicking in the editor triggers any event from the buttons. Your example from stackblitz don't have this problem. But when I copy your component code to my code again I have this problem.
Could you try removing :disabled="!editor.can().chain().focus().toggleBold().run()"
No different. I will see if I can create a test project on codesandbox tomorrow.
Ok I find out the problem. My TiptapEditor
component was surrounded by a label:
<label class="form-control w-full mt-4">
<div class="label">
<span class="label-text text-base font-bold">{{ $t('linkContent') }}</span>
</div>
<TiptapEditor :content="selectedPage.content" @update-content="updateContent" />
</label>
Removing the label fixed the issue.
Sorry for taking your time!
No problem!
Hello, I have here a strange behaviour: When I click on a text, it triggers the first formatting button. When I add a empty button (
<button></button>
), nothing get triggered, but then the text window get noProseMirror-focused
class.Do you have any idea what I'm doing wrong?
My component looks like:
https://github.com/modbender/nuxt-tiptap-editor/assets/2212056/b56cfc65-156e-4fca-a04e-e1a0aa1337f9