-
Notifications
You must be signed in to change notification settings - Fork 9
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
Text Nodes Cannot Be Selected When Siblings Are Element Nodes #11
Comments
@sshaw did you wrap it with a Is it possible to see this page? |
Page is not public but this demonstrates the issue: <!DOCTYPE html>
<html lang='en'>
<head>
<title>Foo</title>
</head>
<body>
<h1>Foo</h1>
<div style="width:300px; margin: auto">
<div style="float:right">
<button>Filter</button>
</div>
866 results
</div>
</body>
</html> Adding a I haven't looked at your code but from the markup it looks like it requires an element with a |
@sshaw I understand the problem now and indeed my code will never detect this case. In my opinion, having loose text nodes is never a good practice so I would say that adding a |
What's the issue?
Heh. There's nothing wrong with loose text, it's definitely not a bad practice |
This extension looks for terminal elements (or elements without children) and allows you to select those elements and see their properties. Otherwise you would be able to select a lot of undesirable elements that most people don't even know are there. For your specific case the div that contains "866 results" is not terminal. It contains another Text nodes cannot have a class so the only possibility here would be to also allow elements that contain text nodes to be selected. However, I think this would be confusing because the parent element size won't necessarily be the size of the clicked text.
I didn't mean to say there is something wrong with it but from my experience they never make anyones life easier. |
Given this:
"866 Results" cannot be selected. If I wrap it in a
span
, it can be..search-options__actions
is floated right.The text was updated successfully, but these errors were encountered: