Bug: How to debug OnChangePlugin not firing?
See original GitHub issueI’m following the code sandbox example provided here: https://codesandbox.io/s/lexical-plain-text-example-g932e
and as far as I can tell there are no meaningful differences between the sandbox example and what I’m running locally, but my OnChangePlugin does not fire.
I’ve replaced the body of the onChange
function with the following and do not see this in my logs:
onChange={(editorState, editor) => {
console.log('on change');
}}
The AutoFocusPlugin
works correctly and I see the blinking cursor. When I type, I do not see any text updates. I’m not setting anything for initialConfig.editorState
. I did have this working at some point back on the 0.2.1
version but recently updated due to some placeholder formatting issues.
Any help would be appreciated 🙏
Package versions:
"@lexical/react": "0.3.5",
"react": "18.1.0",
"react-dom": "18.1.0"
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
onChange doesn't fire if input re-renders due to a setState() in ...
When I added debugger statements within the relevant useEffect hook I could see the text appear in the input then disappear within the...
Read more >onchange function not getting triggered in custom wordpress ...
Try like this. jQuery(document).ready(function($){ $(document).on('change','#city_id', function(){ alert("Function Called"); }); });.
Read more >OnChange not working for type Encrypted text - ServiceNow
Hi, I create a field with type Encrypted Text, I add a client script (onchange) on that field, but my script it's not...
Read more >[ZK-3565] spinner instant=true not firing onChange - ZK-Tracker
spinner instant=true not firing onChange ... Debug Info. works in 8.0.2 ... Bug - A problem which impairs or prevents the functions of...
Read more >Activation Events | Visual Studio Code Extension API
onDebugResolve :type is fired just before the resolveDebugConfiguration method ... views contributed by your extension do not require a corresponding onView ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I figured it out! I had upgraded my
@lexical/react
package but notlexical
.lexical
was still stuck at0.2.4
. After upgrading it to0.3.5
, everything’s working again! Thanks for all the help and my apologies for not including a sandbox. Things were working in the sandbox as you demonstrated so my issue was figuring out what was different between the sandbox and my local haha.Thanks again @always-maap and @harish-sethuraman 🙏
I guess may be you missed to fix the import from default import to named import? (This is what I missed while migrating from older version to new one)
you have to do
import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";