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

Check if hiddenTextarea is in current body #292

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jul 28, 2020

  1. Check if hiddenTextarea is in current body

    In situations where the `document.body` was replaced, the check if `hiddenTextarea.parentNode === null` would return `false` even if in fact the _new_ `document.body` had no current `hiddenTextarea`, thus requiring a new one to be appended. The new logic checks if `!document.body.contains(hiddenTextarea)`, which should account for the _current_ `document.body`.
    
    An alternative solution would be to check if `hiddenTextarea.isConnected`, which is probably more performant. Unfortunately, this property is not present in IE.
    
    Yet another solution which _might_ be more performant at the expense of being more verbose, is to recursively check if `hiddenTextarea.parentNode === null` to confirm that it's in fact still in the _current_ DOM tree.
    
    Fixes Andarist#247
    mendelk committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    a43519c View commit details
    Browse the repository at this point in the history