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

feat: insert before method element deno dom #76

Closed
wants to merge 6 commits into from

Conversation

shadowtime2000
Copy link
Member

Partially resolves #75, implements insertBefore in the Element class for SSR.

} else {
for (let i = 0; i < this.childNodes.length; i++) {
//TODO: use deep equal or something
if (this.childNodes[i] === existingNode) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the best way to see if they are equal because === won't work?

if (!existingNode) {
return this.appendChild(newNode);
} else {
for (let i = 0; i < this.childNodes.length; i++) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used for loops in such a long time I feel like it isn't looping fully over the this.childNodes, correct me if I am wrong.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're doubting me, but I really think it's right.

@@ -370,4 +370,30 @@ export class Element extends Node {
}
return null
}

insertBefore(newNode: Node, existingNode: Node | null) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not ready for merge yet, insertBefore is a Node method so I will move it shortly.

@ije
Copy link
Member

ije commented Jan 1, 2021

@shadowtime2000 , I'm trying to remove the deno-dom in v0.3, it's hard to add ployfills for some packages using dom api. can not be everywhere...

@shadowtime2000
Copy link
Member Author

@shadowtime2000 , I'm trying to remove the deno-dom in v0.3, it's hard to add ployfills for some packages using dom api. can not be everywhere...

good point, closing this PR then.

@shadowtime2000 shadowtime2000 deleted the issue-75-partial-fix branch January 10, 2021 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't work with Microsoft's FluentUI
3 participants