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

Update attributes when non-editable #1415

Closed
Winexcel opened this issue Jun 4, 2021 · 3 comments
Closed

Update attributes when non-editable #1415

Winexcel opened this issue Jun 4, 2021 · 3 comments
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@Winexcel
Copy link

Winexcel commented Jun 4, 2021

I wrote my own spoiler extension, it works like a charm, but when I set my editor to non-editable, my spoiler doesn't work, button which update "show" attribute doesn't work.

I set editor to non-editable mode like this:
this.editor.setEditable(false);

My spoiler works very easy, I just update "show" attribute when click by the button.

Is it possible to update attributes and react to DOM events in non-editable mode?

@Winexcel Winexcel added Type: Bug The issue or pullrequest is related to a bug v2 labels Jun 4, 2021
@Winexcel
Copy link
Author

Winexcel commented Jun 6, 2021

I add a github repo for this problem, i solved this by replacing show attribute, i just duplicate show in my component and toogle this data property, but i also dispatch this property to tiptap. https://github.com/Winexcel/tiptap-spoiler

I think this approach might be bad, therefore i need some feedback from core team about this problem.

@Winexcel
Copy link
Author

Winexcel commented Jun 6, 2021

And another problem which i have with this approach - i can't nest one spoiler to another, i don't know why it doesn't work, but if i set content with nested spoilers - it works! Magic!)

image

Why i can't add spoiler into another from commands?

@philippkuehn
Copy link
Contributor

As discussed in #1239 I also removed the editable check in updateAttributes.

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

2 participants