nhn / toast-ui.react-image-editor

TOAST UI ImageEditor wrapper for React.js
MIT License
117 stars 51 forks source link

submenus stay in old status when i reload a new image #21

Open ierover opened 4 years ago

ierover commented 4 years ago

1.2.0

Test Environment

Google Chrome, macOS

Current Behavior

1.do some action on the submenu, changed the submenu UI status
2.call loadImageFromURL to reload a new image to editor
3.reactive the menu last time i use
4.the pop up submenu still in the old UI status.......

for example:
1. i checked the Sepia checkbox on submenu of Filter
2. i called editorInstance.loadImageFromURL(url,name) , reloaded a new Image 
3. i opened Filter menu again, Sepia checkbox was still in checked status

i think it's not what user is expecting, but i have no way to change the behavior

Expected Behavior

Provide an instance method, which can initialize the Menu and Submenu

crisilva95 commented 4 years ago

I have the same issue!

russian-proger commented 4 years ago

You can change a “key” prop after loading a new image. This can help, because react creates a new element, when its key has been changed

crisilva95 commented 4 years ago

Thank you @russian-proger, it worked!

russian-proger commented 4 years ago

I’m pleased to help :)

rwilson504 commented 4 years ago

@russian-proger Could you please give an example of how you would change a 'key' prop? I'm trying to use this in a React functional component.