wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
664 stars 143 forks source link

Shortcode-UI highjacks the Media Uploader modal #691

Closed AndonDesign closed 7 years ago

AndonDesign commented 7 years ago

Noticed that once you've inserted a shortcode using the "Insert Post Element" modal and then try to insert an image into the editor using the WP native "Add Media" button, the media uploader modal will open at the last used "Insert Post Element" tab rather than the "Insert Media" tab. I know they both share the same modal but it seems it hangs on the Shortcake one after it's been used once.

I see this as potentially being confusing to the average user as they will try to insert an image and will not see the images but the shortcode elements. Not sure if this is a caching related issue or just that the modal needs to be reset after used with Shortcake.

Can someone else confirm this, not sure if it's a bug or has been discussed previously, I could not find another issue report on it.

htrex commented 7 years ago

I'm using WP 4.7 with Shortcake 0.7.0 (from official WP repo) and seeing the problem. This is an UX problem, not a bug. The user can switch to the Insert Media tab and it works to insert an image, but I agree with you, the user should directly see the media tab when he/she clicks it.

goldenapples commented 7 years ago

Some previous discussion is here: https://github.com/wp-shortcake/shortcake/pull/551#issuecomment-246858766 and here: https://github.com/wp-shortcake/shortcake/pull/689#issuecomment-273938159

The gist of our discussions around this: WP core expects that the modal state to be preserved when its closed (see discussion on https://core.trac.wordpress.org/ticket/27480 for some rationale behind that decision), so that was the approach we initially took with this. After trying to make the UI make sense, though, I think we agree with you that the shortcode-ui modal should reset its state when closing to avoid this weird UI issue.

689 will address this, once it's finished up and merged.

goldenapples commented 7 years ago

I believe this is resolved with #689 - closing this issue.