Comments (5)
There is a note in the README that explains that why you have to bind to onKeyUp
to receive events from keys like enter
, backspace
or delete
. Please try this and let me know.
from react-quill.
You can bind onKeyDown
or onKeyUp
on the element containing the editor and you'll receive an event as usual. You can wrap the editor into another component, or build a custom component using the mixin.
I want to allow a few more events on the editor, such as keypress events, but I want to hear what they would be used for before. Do you have a specific use-case?
from react-quill.
The methods onKeyDown/onKeyUp do not listen for the "enter" key button press (but they do for other keys). I just tested this by binding them to the element containing the editor.
However, I did find an alternate solution. Via the onChange method on the ReactQuill component, I can query for the "enter" key button using this statement which yields a value of 10:
delta.ops[delta.ops.length -1].insert.charCodeAt(0);
My use case is very specific. I'm allowing users to use the text editor while watching videos. When pressing letter keys the video automatically pauses. When pressing the "enter" key, the video resumes playing.
from react-quill.
It seems there is an issue where Quill prevents keydown
events for enter
, backspace
and delete
from bubbling up. But you can still receive them when using onKeyUp
.
I've just pushed some "official" hooks for keypress events so that you won't have to hook them on a separate container. See also [the note about onKeyDown
] in the README, which should explain the situation.
Let me know if this works for you!
from react-quill.
I just downloaded version 0.2.2, and onKeyPress does not work for me. Neither does onKeyDown.
from react-quill.
Related Issues (20)
- What could be the possible reasons for Tamil font not working properly in the Quill editor, and how can this issue be addressed or resolved?
- Disable html tag conversions HOT 1
- How do I change indent class name into style in react quill editor?
- Need to add a custom Add video button and retain the existing embed link
- Sometimes quill editor show '?' in the display
- because if I paste a string with latex syntax it doesn't work
- Unable to directly paste screenshots into rich text in Safari browser
- Calibri Font in React-Quill HOT 1
- react-quill remove <p> tag's class or combine <p> tag HOT 3
- Proper Approach to Using an Image Handler HOT 1
- Server Side Rendering (NextJS) and React Quill (my descent to madness) HOT 1
- quill.history.undo() not working in typescript HOT 1
- chunk-QYYA6GZJ.js?v=86847e0a:9145 Uncaught TypeError: Cannot read properties of null (reading 'innerHTML') at IconPicker2.selectItem (react-quill.js?v=fb924d18:9699:47) at new IconPicker2 (react-quill.js?v=fb924d18:9691:23) at react-quill.js?v=fb924d18:7019:30 at Array.map (<anonymous>) at SnowTheme2.buildPickers (react-quill.js?v=fb924d18:7014:42) at SnowTheme2.extendToolbar (react-quill.js?v=fb924d18:9928:24) at SnowTheme2.addModule (react-quill.js?v=fb924d18:6982:26) at react-quill.js?v=fb924d18:6254:29 at Array.forEach (<anonymous>) at SnowTheme2.init (react-quill.js?v=fb924d18:6252:53) HOT 2
- adding modules as a props i am getting this error
- How to render the HTML template with background-color and styles in editor
- Please help me, I want to build my project, but this is the error that comes out: node_modules\quill\dist\quill.js (7661:11) @ document ⨯ ReferenceError: document is not defined HOT 1
- Number Resets when enter space bar
- Upgrade Quill to remove the deprecated DOMNodeInserted mutation event HOT 1
- How to insert HTML(like <div>) into <div calssName="ql-container">
- React 19 will remove findDOMNode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-quill.