Editor.nodes function doesn't return the node.
See original GitHub issueconst isBlockActive = (editor, format) => {
const [match] = Editor.nodes(editor, {
match: n => n,
})
console.log(match)
return !!match
}
I am getting undefined
, I am supposed to get the node. :l
I cloned it from richtext.js but the isBlockActive
function doesn’t seem to work.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Don't use Node.nodes to only iterate child nodes #3867 - GitHub
All this code is doing is using Node.nodes to iterate over all the child nodes in an array, but it ends up calling...
Read more >Collapse to function creates a return node you can't delete
If you use the “Collapse to Function” menu item it creates a new function with a return node that can't be deleted.
Read more >BUG: table.row(...).node(...).to$ is not a function - DataTables
Does not return an API object, so you can't call to$() on it. Instead, one must call row().nodes().to$() (note the plural on node)....
Read more >Using the Node-Red Function Node- Beginners Guide
When a function node doesn't return anything the nodes connected to the function output aren't triggered and the flow stops for that path....
Read more >Yet another question about function error returning a string
First off yes I have spent a lot of time reading the documentation on JSON and Node Red working with messages as well...
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
its an issue with gatsby, fix it using:
In my opinion, this function has to use editor.selection, because we only want to mark the format buttons as active, when user has a element selected, which uses the format. (So he then could toggle it off) In my solution i only use only the cursor position, but it seems to work for me. In this workaround im searching in the editor.children for the format myself: