3

I've setup react-quill in my React app, but for some reason the spacebar isn't working.

import React from 'react'
import ReactQuill from 'react-quill'
import 'react-quill/dist/quill.snow.css'

const modules = {
    toolbar: [
        ['bold', 'italic', 'underline','strike', 'blockquote', 'code-block'],
        [{'list': 'ordered'}, {'list': 'bullet'}],
        [{ 'script': 'sub'}, { 'script': 'super' }],
        ['link', 'image']
    ],
}

export default () => {
    return (
        <ReactQuill
            theme='snow'
            value={value}
            onChange={value => handleComment(value)}
            modules={modules}
            placeholder={placeholder}
        />
    )
}

When I hit the spacebar, it just doesn't update the state, and I don't know why. Does anyone know what I'm doing wrong, every other key works and updates the state.

willmahoney
  • 371
  • 1
  • 2
  • 9
  • could you show the rest of the component? Seeing `value`, `placeholder` and`handleComment` for example would be helpful – Y. Gherbi Jun 06 '23 at 12:33

1 Answers1

1

If you are facing this problem...then try preserveWhitespace={true}. May be it will help you

  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – DSDmark Jun 09 '23 at 15:12