onMouseUP event is not working in react js
I have an issue with my react-web-app. I have added an onMouseUP
event on react-quill
in react.js but it's not working. I have tried it in many ways but it's not working can anybody help me with that? Just check if I had made any mistake and please tell me so I can fix it.
import React from 'react';
import { useState } from "react"
import ReactQuill from "react-quill"
import "quill-mention";
import './App.css';
import "../node_modules/react-quill/dist/quill.snow.css"
function App(props) {
let initialState = {
text: outside_text,
received : false,
focus : "sds"
}
const modules = {
toolbar: [
[{ 'header': [1, 2, false] }],
['bold', 'italic', 'underline'],
['link', 'image'],
[{'list': 'ordered'}, {'list': 'bullet'}],
['clean']
],
}
const formats = [
'header',
'bold', 'italic', 'underline',
'list', 'bullet',
'link', 'image'
]
const handleChange = (value) => {
setTodo({ text: value})
}
const handleFocus = () => {
console.log("hello")
}
const checkreceived = (received) =>{
if (received===true){
setTodo({text: "Information from the button was received!",received : false })
}
}
checkreceived(todo.received)
return (
<div>
<button
onClick={() => setTodo({received : true})}>
Activate Lasers !
</button>
<ReactQuill
id='react-quill'
value={todo.text}
onMouseUp={handleFocus}
onChange = {handleChange}
modules={modules}
formats = {formats}
theme = "snow"
/>
<textarea
disabled
value={todo.text}
/>
<textarea
disabled
value={todo.focus}
/>
</div>
)
}
const outside_text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,'
export default App;
Doesn't look like ReactQuill
supports onMouseUp
event, only the props specified in the docs:
https://github.com/zenoamaro/react-quill