4

What is the "universal: true" statement in the following code for?

isAziendaMarkActive(editor) {
    const [match] = Editor.nodes(editor, {
    match: n => n.isAzienda === true,
    universal: true,
})

Thanks so much, Elena

elena
  • 123
  • 1
  • 11

1 Answers1

0

Setting universal: true returns the matching nodes if and only if all of the selected nodes match your query.

So, in your case, isAziendaMarkActive() would return false for the following selection:

<AziendaMark> A </AziendaMark>   B   <AziendaMark> C </AziendaMark>

but true for this:

<AziendaMark> A B C </AziendaMark>

See: https://github.com/ianstormtaylor/slate/issues/3248#issue-533523682

Awjin
  • 172
  • 1
  • 12