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

Expose roots to afterRefresh hook. #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Commits on Aug 14, 2024

  1. Expose roots to afterRefresh hook.

    This allows for direct manipulation of the DOM after you are done
    rendering it.  Useful for focusing elements and other things.
    marrs committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    aa787bf View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2024

  1. Render text nodes via their parent element

    This patch fixes a bug I experienced when working with contenteditable
    elements.
    
    It turns out that deleting the text of a contenteditable element
    causes the text node to be removed from the DOM and replaced with
    a <br> element instead.
    
    domChanger apparently does not expect text nodes to ever be removed by
    the browser, presumably because the contenteditable attribute either
    didn't exist or wasn't considered at the time of writing.  So it
    continues to store a reference to the text node in its tree after it
    has been removed from the DOM.  It will continue to update this node
    on subsequent renders, but the user will never see them as the node
    is no longer attached.
    
    This patch fixes that issue by not storing any references to text nodes
    at all, but instead by altering their contents using their parents'
    innerText property.
    
    This should work fine as there is only ever one text node per element
    and its value should always be the same as the value of innerText.
    marrs committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    0e29d49 View commit details
    Browse the repository at this point in the history