scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.66k stars 193 forks source link

Cannot write more than 1 char in controlled component with Safari #96

Closed marwej closed 6 years ago

marwej commented 6 years ago

For some strange reason I cannot write more than one character at a time in Safari. If a use an arrow key or click in editor I can write the next char. Works well in Chrome.

I have a feeling that I've just missed something here but really cannot figure out what.

react-codemirror2: 5.0.1 codemirror: 5.38.0 react: 16.4.1 Safari: 11.1.1

<CodeMirror
            key='editor'
            className='json-editor'
            value={this.state.value}
            onBeforeChange={(editor, metadata, value, next) => this.setState({ value })}
            //onChange={(editor, metadata, value) => {}}
            options={{
              lineNumbers: true,
              mode: {
                name: 'javascript',
                json: true,
              },
              indentUnit: 4,
              theme: 'default',
              extraKeys: { 'Cmd-S': save },
            }}
          />
scniro commented 6 years ago

@marwej I don't see much wrong with this, have you by chance collected any more details here? Seems to work as expected on my end with Safari latest

scniro commented 6 years ago

@marwej closing as I can't reproduce. I would imagine droves of users would be screaming atop a mountain if this just wasn't straight up working in Safari, so since this is the first I've heard I suspect the issues lies on your end. Please reopen if you can provide more detail or a fully reproducible example.

marwej commented 6 years ago

My bad. Had a user-select: none in a general stylesheet which was affecting the <textarea /> in Safari. Really sorry for the inconvenience.