#3927 closed defect (bug) (invalid)
Dragging and dropping uploaded image can retain the onclick="return false;" attribute
Reported by: | johnbillion | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 2.1.2 |
Component: | Administration | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Steps to reproduce:
- Open up the New Post writing screen and make sure you're using the visual editor.
- Upload an image using the inbuilt upload box, or click on Browse All to see your existing uploads.
- If you've clicked Browse All then single click on an image (must be an image) to open up the further options.
- Drag and drop the image from there onto your post editing box.
- Now switch to the 'code' tab or publish the post and then view it
- Note that the hyperlink retains the
onclick="return false;"
attribute which is used internally in the upload box.
Tested in Firefox 2 on Windows XP. Doesn't affect IE or Opera as you can't drag and drop with those anyway.
This means if the hyperlink is clicked on the published post, nothing happens as the return false
kicks in.
Affects 2.1 release and 2.2 bleeding as of r4999.
Change History (10)
#2
follow-up:
↓ 3
@
18 years ago
- Keywords dev-feedback 2nd-opinion added; uploading needs-patch removed
- Owner changed from anonymous to andy
- Priority changed from normal to low
- Version changed from 2.1 to 2.1.2
#3
in reply to:
↑ 2
;
follow-up:
↓ 9
@
18 years ago
Replying to rob1n:
Also, I don't know if this is necessary to be fixed, as I never even thought of dragging and dropping before I read this ticket. The controls provided do the job fine...
I see it all the time on WordPress.com , it is an intuitive action.
#6
@
17 years ago
The solution here would be to apply the onclick="return false"
action to the link dynamically, therefore it wouldn't show up inside the a
tag when you dragged it into the post editing textarea. The upload JS is crazy though and I can't figure it out myself.
#7
@
17 years ago
- Owner andy deleted
History: When uploading was first added to the edit form it was supposed to work by drag-and-drop. We canned that when it became evident that IE's drag-and-drop implementation does not provide complete information to the target element. Therefore we do not support drag-and-drop and we added "send to editor" functions instead.
Anybody is welcome to work out a patch to make this work better for the adventurous drag/dropper.
#8
@
17 years ago
foolswisdom: nobody on wordpress.com has the unfiltered_html capability so kses strips the onclick, making this a non-issue. This only affects users with unfiltered_html.
#9
in reply to:
↑ 3
@
17 years ago
- Milestone changed from 2.3 to 2.4
Replying to andy:
foolswisdom: nobody on wordpress.com has the unfiltered_html capability so kses strips the onclick, making this a non-issue. This only affects users with unfiltered_html.
Gotcha, it does work in Firefox at WordPress.com .
Replying to foolswisdom:
Replying to rob1n:
Also, I don't know if this is necessary to be fixed, as I never even thought of dragging and dropping before I read this ticket. The controls provided do the job fine...
I see it all the time on WordPress.com , it is an intuitive action.
I think in my comment I was referring to people trying to drag and drop an image. Which is an intuitive action to many people based on my experience helping people at WordPress.com and using other applications. As you described Andy is disabled for IE (including IE7 maybe they have smartened up?).
Reproduced.
I believe this is a Firefox/IE issue (and it's not really an issue). The drag-n-dropping isn't done by JS by WordPress -- it's a built in function to drag any link to any text area/input box.
I don't know how we can fix this. Maybe add a filter to clean those links out once the contents of the post contents area has changed? Like I said, this is going to be tricky.
Assigning to andy, as he's the in-house JS guru ;).
Also, I don't know if this is necessary to be fixed, as I never even thought of dragging and dropping before I read this ticket. The controls provided do the job fine...