core icon indicating copy to clipboard operation
core copied to clipboard

Interpolation in an elements slot creates invalid output if element is created with <component is> and has contentediable attribute

Open liuhanqu opened this issue 2 years ago • 2 comments

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9UU1r3DAQ/StTUbADawmaQ8HshpRS6KE99dCLLt7VZKNWloQ09iYY//eOvNnt5oMcDJ6ZN++N3pvElxjlOKBoxTrvko0EGWmIN9rbPoZEMEHCuxUE/zMMntDADHcp9FDxVqW99rvgM0Gf97Ap0Lr6js4F+B2SMx+qqxPgI7ongB+c47b2Z866voLNDUzaQ8HJsXMDys6YbyN6+mEzocdUV1s3pGoFF2iAwh4cShf29f9dwgf6GpjbE0sVHB94nPEVb+IKbGZw+QBOZ1NX3lUZOy6PXaujS+wPF4R9dB0hVwDrXWDHPDNBa/NGC17VotxX2NFY6rYOuc8rlhsP1ATvHhnCpnCbj+L/NtPjgpoO95bwV+x22EIVEzaH1MVq1mJRA5imxfR5XsTVWZ3Ha3W+TKzEMcim76L8k4PnqBfr9NMga9GezNSCUy21FvdEMbdKDT7+3UtmV7c8U4kDsz02JvS31/KTvP6sDOdz2ZeY+2abwiFjYkUtVhfkipsjpiahN5gwvSv2AvtM8MXslegSJ6cp5n8XQv7g

Steps to reproduce

  1. double click to edit content
  2. use enter to make a line
  3. input something, like cc
  4. blur

What is expected?

the content is Hello World \n cc

What is actually happening?

the content is Hello World \n cc \n cc

System Info

No response

Any additional comments?

No response

liuhanqu avatar Aug 10 '22 09:08 liuhanqu

temporally use v-text to solve this problem

liuhanqu avatar Aug 10 '22 09:08 liuhanqu

image

It will add a new text Node after press enter. Vue only patch the focused text Node when blur. That's why the textContent is incorrent.

edison1105 avatar Aug 11 '22 01:08 edison1105