Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Missing Element.remove #447

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

Closed
OndrejSpanel opened this issue Apr 30, 2021 · 2 comments · Fixed by #561
Closed

Missing Element.remove #447

OndrejSpanel opened this issue Apr 30, 2021 · 2 comments · Fixed by #561

Comments

@OndrejSpanel
Copy link

It seems DOM Element (in org.scalajs.dom.raw) misses the remove method.

It can be replaced by e.parentNode.removeChild(e), but I think there is probably no reason not to add it.

@strelec
Copy link

strelec commented Jul 11, 2021

Many more elementary DOM operations are missing (all of them very well supported in the browsers):

	@js.native
	trait ElementExt extends HTMLElement {
		def remove(): Unit = js.native
		def before(nodes: Node*): Unit = js.native
		def after(nodes: Node*): Unit = js.native

		def replaceChildren(nodes: Node*): Unit = js.native
		def prepend(nodes: Node*): Unit = js.native
		def append(nodes: Node*): Unit = js.native
	}

@armanbilge
Copy link
Member

@strelec would you mind opening a PR with those additions please? Would be much much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants