#38849 closed defect (bug) (fixed)
Shortcode wpview's toolbar appears while no view is selected
Reported by: | bduclos | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | 4.6.1 |
Component: | TinyMCE | Keywords: | has-screenshots has-patch |
Focuses: | javascript | Cc: |
Description
When you copy paste a shortcode wpview, the toolbar with the edit/delete buttons appears above the pasted view while the view is not selected (clicking on the buttons does nothing).
It also happens when you refresh a page and the first element of the editor is a shortcode view.
Bugs on all browsers in Trunk and WP4.6
Attachments (1)
Change History (14)
#3
@
8 years ago
- Keywords has-screenshots added; needs-screenshots removed
Steps to reproduce:
Click on the Add Media button to create and insert a gallery. Copy the gallery view (Ctrl+C) and paste it after (Ctrl+V).
Result:
The toolbar with the edit/delete buttons appears above the pasted view while the view is not selected. Clicking on the edit or delete buttons does nothing. However if you click on the view to select it, the buttons work normally.
#4
@
8 years ago
- Focuses javascript added
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Version changed from trunk to 4.6.1
#5
@
8 years ago
- Keywords has-patch added; needs-patch removed
The patch checks that the view is selected before setting the toolbar on the wptoolbar
event in "tinymce/plugins/wpview/plugin.js".
There's also a change to the nodechange
action in "tinymce/plugins/wordpress/plugin.js" just after it fires the wptoolbar
event, to make sure the toolbar is repositioned and shown always, in case a selected view is scrolled out of view and then a different (visible!) view selected, which could have resulted in the toolbar not displaying on the newly selected view.
#7
@
8 years ago
I'm able to reproduce this every time now. It's triggered by firing multiple nodechange
events in the editor. This event is used to set or refresh the inline toolbar and seems to error out when it is fired more than once for the same element, especially after the initial loading of HTML in the editor.
Looking at 38849.patch, don't think we need to change the floating toolbar code. It is enough to check whether the selection is collapsed when a wpview node is selected.
#9
@
8 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 39904:
#10
follow-up:
↓ 11
@
8 years ago
I suppose you could consider it a different bug but I just checked again and can reproduce the second scroll issue on Firefox/Chrome on Ubuntu, Safari/Firefox/Chrome on macOS, and Edge/Firefox/Chrome on Windows 10.
I'm pretty sure I've seen this too, although I wasn't able to track down the cause when I looked into it.