Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow input typing if dragglable is true #264

Closed
lucastsudaka opened this issue Apr 12, 2019 · 5 comments
Closed

Slow input typing if dragglable is true #264

lucastsudaka opened this issue Apr 12, 2019 · 5 comments
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@lucastsudaka
Copy link

lucastsudaka commented Apr 12, 2019

Hi,
There is one problem if you insert an input field inside get view() and type something
https://codesandbox.io/s/qvn50vv964
(click youtube video and type in the field)

This problem dont occurs with draggable false

Seemsn this happens cause the editor need to update.

@philippkuehn philippkuehn added the Type: Bug The issue or pullrequest is related to a bug label Apr 30, 2019
@Chrissi2812
Copy link
Contributor

@philippkuehn What exactly does this part of the code? https://github.com/scrumpy/tiptap/blob/0e59e0cc0c2b4f0be5c46ebf2a698c674bfda821/packages/tiptap/src/Utils/ComponentView.js#L103-L107

Because if it returns false the component no longer gets destroyed on each prop change.

Maybe implement a check like this?

  // prevent a full re-render of the vue component on update
  // we'll handle prop updates in `update()`
  ignoreMutation() {
    return !(this.editable && this.extension.schema.draggable)
  }

@philippkuehn
Copy link
Contributor

I'm not sure what's the difference between your sandbox and this embed example. Even if I set draggable to true, the demo works without the described problem 🤔

@Chrissi2812 It's not a good idea to change the behavior of ignoreMutation. By default ProseMirror re-renders a node view whenever an attribute changes. In some situations this makes it impossible to use tooltips or fade-in transitions for example.

@lucastsudaka
Copy link
Author

In the newer versions with "stopEvent()" is possible to control this behavior.
https://codesandbox.io/s/qvn50vv964 (see components/iframe.js)
Thanks @philippkuehn, amazing job!

@Chrissi2812
Copy link
Contributor

Can confirm that with 1.17.0 this works without much problems.
Even without stopEvent as mentioned by @lucastsudaka.
The only thing I have noticed is that as soon as you press backspace the embed gets deleted. @keydown.stop on the input element prevents this behaviour.

@philippkuehn
Copy link
Contributor

Please reopen if this issue is still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants