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

cursor plugin: fix element removal in destroy #2462

Merged
merged 4 commits into from
Feb 28, 2022
Merged

cursor plugin: fix element removal in destroy #2462

merged 4 commits into from
Feb 28, 2022

Conversation

JanMisker
Copy link
Contributor

@JanMisker JanMisker commented Feb 27, 2022

When the plugin destroy() method get called, I got an error because removeChild() was called with something that wasn't a Node, for this.showTime and this.cursor.

Short description of changes:

It seems that showTime and cursor are Proxy objects, and the removeChild() doesn't swallow that. Changing from e.g. removeChild(this.cursor) to this.cursor.remove() on the Proxy objects seems to fix this.

Breaking in the external API:

n/a

Breaking changes in the internal API:

n/a

Todos/Notes:

n/a

Related Issues and other PRs:

fixes #2460

When the plugin destroy() method was called, I got an error because removeChild was called with something that wasn't a Node, for this.showTime and this.cursor. 
It seems that these members are Proxy objects, and the removeChild doesn't swallow that. Changing from removeChild to remove() on the Proxy objects seems to fix this.
@thijstriemstra thijstriemstra changed the title Bugfix how elements are removed upon destroying cursor plugin: fix element removal in destroy Feb 27, 2022
@coveralls
Copy link

coveralls commented Feb 27, 2022

Coverage Status

Coverage remained the same at 81.653% when pulling 7d07d44 on JanMisker:patch-1 into e2c5e64 on katspaugh:master.

Copy link
Contributor

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

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

thanks @JanMisker Can you also add a changelog entry (for new 6.0.3) with a reference to #2460?

@JanMisker
Copy link
Contributor Author

Check, added an entry in the changelog.

@thijstriemstra
Copy link
Contributor

now there's a merge conflict, probably in changelog

@JanMisker
Copy link
Contributor Author

I can't really resolve that change I think, but adjusted CHANGES.md to be just the addition of 'my line'.

Copy link
Contributor

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

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

thanks.

@thijstriemstra thijstriemstra merged commit 709a4e0 into katspaugh:master Feb 28, 2022
@caugner
Copy link
Contributor

caugner commented Mar 1, 2022

Thanks @JanMisker, much appreciated!

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

Successfully merging this pull request may close these issues.

[cursor] Node.removeChild: Argument 1 does not implement interface Node.
4 participants