Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteFromDocument deletes more than just text #34943

Closed
John-Page opened this issue Jul 20, 2024 · 1 comment · Fixed by #35603
Closed

deleteFromDocument deletes more than just text #34943

John-Page opened this issue Jul 20, 2024 · 1 comment · Fixed by #35603
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!

Comments

@John-Page
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Selection/deleteFromDocument

What specific section or headline is this issue about?

First paragraph

What information was incorrect, unhelpful, or incomplete?

It says the method deletes the text in the selection This implies (to me anyway) that it deleted the text nodes or perhaps empties them out. In my tests it actually deletes everything in the selection. I have a div full of text, embedded divs., images etc. If I select the whole thing and call deleteFromDocument(), the embedded divs imgs etc are completely removed. (That's good - that's what was hoping).

What did you expect to see?

Clarity on what is actually removed.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@John-Page John-Page added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jul 20, 2024
@github-actions github-actions bot added the Content:WebAPI Web API docs label Jul 20, 2024
@Josh-Cena
Copy link
Member

This method just calls https://developer.mozilla.org/en-US/docs/Web/API/Range/deleteContents, and I agree both methods' pages are very thin. They should mention what exactly gets deleted.

@Josh-Cena Josh-Cena added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jul 20, 2024
@Josh-Cena Josh-Cena changed the title It deletes more than just text deleteFromDocument deletes more than just text Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants