Skip to content

Commit

Permalink
[ExposedDropDownMenu] Changed the editable exposed dropdown menu's a1…
Browse files Browse the repository at this point in the history
…1y class name to be EditText instead of a drop down since the primary action for the user is to type.

PiperOrigin-RevId: 317650366
  • Loading branch information
leticiarossi authored and ymarian committed Jun 26, 2020
1 parent 20e2388 commit 023e518
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ public void onFocusChange(View v, boolean hasFocus) {
public void onInitializeAccessibilityNodeInfo(
View host, @NonNull AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
// The exposed dropdown menu behaves like a Spinner.
info.setClassName(Spinner.class.getName());
// The non-editable exposed dropdown menu behaves like a Spinner.
if (textInputLayout.getEditText().getKeyListener() == null) {
info.setClassName(Spinner.class.getName());
}
if (info.isShowingHintText()) {
// Set hint text to null so TalkBack doesn't announce the label twice when there is no
// item selected.
Expand Down

0 comments on commit 023e518

Please sign in to comment.