You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a issue in react-quill setEditorSelection I am able to get the editor cursor position but I am not able to set the cursor to specific position can you help me
Here is my code
import React, {Component} from 'react';
import ReactQuill from 'react-quill'
import "react-quill/dist/quill.snow.css";
import './App.css';
console.log(this.reactQuillRef.getEditorSelection().index);
//console.log(this.reactQuillRef);
var range = this.reactQuillRef.getEditorSelection().index;
I also encountered the same problem, when ReactQuill render, I want the cursor position to automatically focus on the last position of the value. I solved the problem by the following way:
I have a issue in react-quill setEditorSelection I am able to get the editor cursor position but I am not able to set the cursor to specific position can you help me
Here is my code
import React, {Component} from 'react';
import ReactQuill from 'react-quill'
import "react-quill/dist/quill.snow.css";
import './App.css';
class App extends Component{
constructor(props) {
super(props);
this.state = { editorHtml: "testing" };
this.handleChange = this.handleChange.bind(this);
this.handleChangeSelection = this.handleChangeSelection.bind(this);
}
handleChange(content, delta, source, editor) {
console.log(content);
console.log(delta);
console.log(source);
console.log(editor.getSelection());
//console.log("IBM"+editor.getHTML()); // HTML/rich text
//alert(event);
//this.setState({ editorHtml: editor.getHt });
}
handleChangeSelection(e) {
console.log(e);
}
moveCursor = () => {
this.reactQuillRef.focus();
}
render(){
return (
}
}
export default App;
The text was updated successfully, but these errors were encountered: