This commit changes `registerPlugin` by 1. adding the new plugin to `this.plugins` and 2. updating `this.plugins` within `this.state.plugins` by splicing with the new `this.plugins` length. Previously, new plugins were simply added to the end of `this.state.plugins` and were not appended to `this.plugins`.
By placing new plugins at this new location within `this.state.plugins`, we prioritize registered plugins over default ProseMirror plugins such as `keymap(baseKeymap)`. This will allow new plugins to have precedence over props such as `handleKeyDown`.
Sometimes the hide event throws an error since the element of the option does not have a parent node. I added a check if the parent node is not null to the hide event.
tiptap.esm.js?cd42:1849 Uncaught TypeError: Cannot read property 'contains' of null
at Menu.hide (tiptap.esm.js?cd42:1849)
at Editor.eval (tiptap.esm.js?cd42:1778)
at eval (tiptap.esm.js?cd42:461)
at Array.forEach (<anonymous>)
at Editor.emit (tiptap.esm.js?cd42:460)
at Plugin.blur (tiptap.esm.js?cd42:1184)
at eval (index.es.js?576a:3113)
at EditorView.someProp (index.es.js?576a:4567)
at runCustomHandler (index.es.js?576a:3111)
at HTMLDivElement.view.dom.addEventListener.view.eventHandlers.<computed> (index.es.js?576a:3076)
Sometimes the hide event throws an error since the element of the option does not have a parent node. I added a check if the parent node is not null to the hide event.
```javascript
tiptap.esm.js?cd42:1849 Uncaught TypeError: Cannot read property 'contains' of null
at Menu.hide (tiptap.esm.js?cd42:1849)
at Editor.eval (tiptap.esm.js?cd42:1778)
at eval (tiptap.esm.js?cd42:461)
at Array.forEach (<anonymous>)
at Editor.emit (tiptap.esm.js?cd42:460)
at Plugin.blur (tiptap.esm.js?cd42:1184)
at eval (index.es.js?576a:3113)
at EditorView.someProp (index.es.js?576a:4567)
at runCustomHandler (index.es.js?576a:3111)
at HTMLDivElement.view.dom.addEventListener.view.eventHandlers.<computed> (index.es.js?576a:3076)
```