#39790 closed defect (bug) (worksforme)
When I click on URL button for add an URL to an image a new line is added
Reported by: | asimioni | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.2 |
Component: | Editor | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
When I click on URL button for add an URL to an image a new line is added.
Steps:
- Select any image
- Click on URL button at toolbar
Just it, a new line is added after the image.
Change History (4)
#2
@
4 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
#3
follow-up:
↓ 4
@
8 weeks ago
@asimioni This issue appears to stem from the editor or toolbar behavior, where clicking the URL button unintentionally inserts a new line after the selected image. Such behavior is often caused by the editor adding a block-level element, such as a <p> tag, after the image when interacting with certain toolbar options. It could also be due to an event triggered by the button click, which might not be properly handled, leading to the insertion of unwanted content.
#4
in reply to:
↑ 3
@
8 weeks ago
Replying to nathan001:
@asimioni This issue appears to stem from the editor or toolbar behavior, where clicking the URL button unintentionally inserts a new line after the selected image. Such behavior is often caused by the editor adding a block-level element, such as a <p> tag, after the image when interacting with certain toolbar options. It could also be due to an event triggered by the button click, which might not be properly handled, leading to the insertion of unwanted content.
To resolve this, inspect the DOM using developer tools to identify changes made to the structure after clicking the URL button. Look for newly added tags, such as <p> or <div>, that may be causing the issue. Additionally, check the event handling for the URL button. Sometimes, the button’s default behavior might include inserting a new block, which can be overridden using JavaScript. Adding e.preventDefault() in the button's click event can help prevent unintended actions.
Hi @asimioni Thanks for creating this ticket. I was unable to reproduce this issue.
Are you able to re-test with no plugins using the default theme and let us know if you're still experiencing the problem? This may also be an issue that has been resolved in a more recent version of WordPress.
Thanks.