Closed AndreeaMoise closed 2 weeks ago
@AndreeaMoise you can look at this workaround to get rid of the unexpected behaviour. You are right about it, it's what the plugin does. Updated code sandbox here : https://codesandbox.io/p/sandbox/web-components-playground-forked-9wzg2x
@rajithaeyee thanks for the help. I was wondering, why is the observer necessary? When I remove the updated
, the sandbox still works. So it seems like updating the modelValue with the textarea value suffices it.
@AndreeaMoise glad you find it useful, and yeah probably it works without updated
because i tried few different workarounds there in the sandbox and might forgot to clean the code 😅. However,the reason to add observer was that the observer ensures that any internal mutations to the <textarea>
are reflected in lionTextarea.modelValue
. 🙌
Alright, clear!
Expected behavior
The modelValueChanged event triggers on all textarea when chrome plugin AI Grammar Checker & Paraphraser – LanguageTool is installed.
Actual Behavior
Having the plugin enabled, the modelValueChange event is not triggered for the first textarea in the page, but it is triggered for a second, third, nth textarea. When the plugin is disabled, everything works correctly.
Sandbox here: https://codesandbox.io/p/sandbox/web-components-playground-forked-23yt3g
Additional context
This is a snippet of the model values when the plugin is enabled. The first one is not up to date, the rest yes.
It is possible that the issue lies on the plugin's side, but maybe you are already aware of a workaround that I could try.