Closed andrewtimberlake closed 1 month ago
@andrewtimberlake in those cases, it's good to have a hidden label (at least as far as I understand accessibility, but I'm not an expert). So what I'd recommend is have a hidden label (with tailwind you could add sr-only
class.)
This is from mdn docs:
The label text is not only visually associated with its corresponding text input; it is programmatically associated with it too. This means that, for example, a screen reader will read out the label when the user is focused on the form input, making it easier for an assistive technology user to understand what data should be entered.
That would allow you to target it with fill_in("Domain", with: "text")
Thanks, that’s what I ended up doing ;-)
Sometimes a form element doesn’t have a label:
It would be nice to be able to use
fill_in("model[field]", nil, with: "text")
or similar.