Open loic-brtd opened 6 months ago
Same issue here
Edit: I found a workaround, set the value of the option as an empty string. For example:
<span class="ql-formats">
<select class="ql-header">
<option value="1">Título</option>
<option value="2">Subtítulo</option>
<option :value="''">Normal</option>
</select>
</span>
Describe the bug
Hi!
In the Editor component with default configuration, when applying "Normal" styling to a text, it renders as
<undefined>Text</undefined>
instead of<p>Text</p>
.I think this problem comes from how the default config for the Quill toolbar, which is configured here : https://github.com/primefaces/primevue/blob/cc9fa3891c5f326a7d9a49b53b5bb81b7672b7a3/components/lib/editor/Editor.vue#L6-L10
The
value
for the "Normal" style should bevalue=""
instead ofvalue="0"
, same fordefaultValue=""
.I didn't find any documentation about this on https://v1.quilljs.com/docs/modules/toolbar but I found an example here https://stackoverflow.com/a/56846200.
Reproducer
https://stackblitz.com/edit/primevue-issue-editor-undefined-tag?file=src%2FApp.vue
PrimeVue version
3.47.2
Vue version
3.x
Language
ALL
Build / Runtime
Vue CLI App
Browser(s)
No response
Steps to reproduce the behavior
npm install quill@1.3.7
(v2 of Quill has breaking changes)const value = ref("
Text
");