react-native-cn-quill icon indicating copy to clipboard operation
react-native-cn-quill copied to clipboard

Placeholder Multiline Issue

Open msultanic opened this issue 2 years ago • 2 comments
trafficstars

The placeholder attribute in the library component fails to handle line breaks correctly, resulting in component crashes. When using line breaks, such as "placeholder="This\nis\nplaceholder"," the component becomes non-functional.

Steps to Reproduce:

  1. Add the library component to a project.
  2. Set the placeholder attribute with line breaks.
  3. Run the project and observe the component crash.

Impact: The inability to use line breaks in the placeholder attribute limits customization options and hinders user experience.

const placeholderText = "This\nis an\nexample";
...
quill={{
 modules: {
   toolbar: false,
 },
   placeholder: placeholderText,
}}

msultanic avatar Jun 27 '23 14:06 msultanic

Hey @msultanic, my PR fixes this, https://github.com/imnapo/react-native-cn-quill/pull/117.

If you use a template string (backticks), then this will render properly in conjunction with my PR.

`What's happening today?\nStart typing...`

jakehasler avatar Aug 15 '23 16:08 jakehasler

Thanks @jakehasler!

msultanic avatar Aug 16 '23 08:08 msultanic