You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the textEditor to edit text (loading a default text into the component, it isnt set in the editor window. But the updateValue emit is running, so the text should be there. I tried to use the 'onBeforeMounted' function to force the update, but no lock. Can someone please tell me if im doing something wrong, or there is a bug.
Use my code to test it, I use it in a form component like this: <InputTextarea v-if="$formTypes.txtarea?.includes(key)" class="w-full" v-model:input="subform[key]" :inputType="subform[key]" :label="getLabel(key)" :placeholder="Vælg en ${getLabel(key)}" :error="showSubError(key) ? showSubError(key) : ''" @updateValue="(e) => updateSubValue(key, e)" />
And here is the InputTextarea component
Describe the bug
When using the textEditor to edit text (loading a default text into the component, it isnt set in the editor window. But the updateValue emit is running, so the text should be there. I tried to use the 'onBeforeMounted' function to force the update, but no lock. Can someone please tell me if im doing something wrong, or there is a bug.
Here is my code:
`
`<script setup>
import { on } from "events";
import Editor from "primevue/editor";
const emit = defineEmits(["update:input","updateValue"]);
const { label, input, placeholder, error } = defineProps({
label: {
type: String,
},
input: {
type: String,
},
placeholder: {
type: String,
},
error: {
type: String,
},
});
const inputComputed = computed({
get: () => input,
set: (val) => {
emit("updateValue", val);
emit("update:input", val);
},
});
onBeforeMount(() => {
if (input) {
emit("updateValue", input);
emit("update:input", input);
}
});
</script>`
PrimeVue version
3.46.0
Vue version
3.x
Language
ES6
Build / Runtime
Nuxt
Browser(s)
Chrome Version 124.0.6367.119
Steps to reproduce the behavior
Use my code to test it, I use it in a form component like this:
<InputTextarea v-if="$formTypes.txtarea?.includes(key)" class="w-full" v-model:input="subform[key]" :inputType="subform[key]" :label="getLabel(key)" :placeholder="
Vælg en ${getLabel(key)}" :error="showSubError(key) ? showSubError(key) : ''" @updateValue="(e) => updateSubValue(key, e)" />
And here is the InputTextarea component
`
Expected behavior
The text in the textarea field should be updated, when text is prefilled.
The text was updated successfully, but these errors were encountered: