question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] `text=` selector to match <input type="text" placeholder="This is placeholder">

See original GitHub issue

In my opinion one should also consider “placeholder” when searching an element(input) by text. This is because most of the inputs can be identified by placeholders when it does not have a value. Becomes very useful if one needs to fill Text based on input’s placeholder. So test code will look as follows Element: <input type="text" placeholder="This is placeholder"> Code: await page.fill(text="This is placeholder", "new value")

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dgozmancommented, Jul 30, 2020

This makes sense. The only question is whether to match placeholder when there is some text in the input?

  • If we don’t, that would mean the previous selector does not work anymore after calling fill() which is not ideal.
  • If we do, then we’ll get matches for the text that is not on the page anymore, because browser does not render placeholder for non-empty input, which is also not ideal.

Given that, perhaps leaving it explicit is the best? There would be no surprises, even though you’ll have to write [placeholder="text"].

0reactions
pavelfeldmancommented, Jul 12, 2021

I’ll close this as a part of the bug triaging process. We have hundreds of bugs and feature requests with dozens and even hundreds of upvotes, while this one only has a few thumbs up. Please feel free to open a new bug and link this one if you’d like to see it addressed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

::placeholder | CSS-Tricks - CSS-Tricks
:placeholder-shown is for selecting the input itself when it's placeholder text is being shown. As opposed to ::placeholder which styles the ...
Read more >
Don't Use The Placeholder Attribute - Smashing Magazine
For someone who has never encountered it before, placeholder text may look like entered content, causing them to skip over the input.
Read more >
placeholder - CSS: Cascading Style Sheets - MDN Web Docs
The ::placeholder CSS pseudo-element represents the placeholder text in an <input> or <textarea> element. Try it. HTML Demo: ::placeholder.
Read more >
HTML DOM Input Text placeholder Property - W3Schools
The placeholder attribute specifies a short hint that describes the expected value of a text field (e.g. a sample value or a short...
Read more >
:placeholder-shown CSS pseudo-class | Can I use... Support ...
Input elements can sometimes show placeholder text as a hint to the user on what to type in. See, for example, the placeholder...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found