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

Selectable items become non selectable when editing a text #25

Open
lk77 opened this issue Dec 10, 2020 · 2 comments
Open

Selectable items become non selectable when editing a text #25

lk77 opened this issue Dec 10, 2020 · 2 comments

Comments

@lk77
Copy link

lk77 commented Dec 10, 2020

Hello,

i have an issue, items become not selectable when doing undo/redo while editing.

Step to reproduce :
1 / Add a text
2 / Edit the text
3 / Do a undo while still editing the text
4 / Do a redo
5 / Text is not selectable anymore

http://jsfiddle.net/lk77/kz59stg7/66/

you can see on the fiddle that when you go on edit mode, selectable become false, and when you leave edit mode, selectable is true again.

but if you do undo/redo it stays like that, and never go back to true

Capture vidéo 2020-12-10 11_20_59

thanks

@alimozdemir
Copy link
Owner

Hello,

Thanks for the jsfiddle, did you try with extraProps ?

    var canvas = new fabric.Canvas('mycanvas');
    canvas.extraProps = ['selectable', 'editable']

Thanks

@lk77
Copy link
Author

lk77 commented Dec 10, 2020

I tried it and it does not solve the issue,
the thing is, when editing, fabricjs is disabling selection of the element

http://jsfiddle.net/lk77/dtkcu1zf/2/

i solved it by doing discardActiveObject(); before undo / redo
it bring back the element to it's normal, non editing mode.

but it means that you cannot undo text changes anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants