Skip to content

Add class to input when dropdown is active #384

Open
@AlecRust

Description

@AlecRust

I'm working with inputs that have a border radius:

screenshot

And when the results are open I'd like to remove the bottom border radius from the input, to achieve:

screenshot

However, there doesn't seem to be a class on the input when the results panel is open for me to do this.

The aria-expanded attribute does change when the results panel has results, so I can do this:

.autocomplete__input[aria-expanded=true] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

But not when the panel is open for the "no results" message. So it only half works:

screenshot

This seems like a pretty common use case that could warrant adding a class for? Or perhaps aria-expanded should be set to true when the results panel is expanded showing "No results"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions