Skip to content

Adding .closest() to more nodes #161

Open
@caub

Description

Text nodes have no .closest method, when working with Range, I find useful to do Text.prototype.closest = function(s) {return this.parentNode.closest(s); } //with this.parentNode&& if we want to be strict

For me it makes sense to be able to search from a textnode, .matches wouldn't make sense (edit: it could, by returning null), but .closest would

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions