Skip to content

Commit

Permalink
[SearchBar] Set the editable property within SearchBar's `Accessi…
Browse files Browse the repository at this point in the history
…bilityNodeInfo` representation.

PiperOrigin-RevId: 572589922
  • Loading branch information
Material Design Team authored and drchen committed Oct 12, 2023
1 parent 6060c40 commit be1395b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/java/com/google/android/material/search/SearchBar.java
Expand Up @@ -343,6 +343,10 @@ public void setElevation(float elevation) {
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(EditText.class.getCanonicalName());
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2) {
info.setEditable(isEnabled());
}

CharSequence text = getText();
boolean isTextEmpty = TextUtils.isEmpty(text);
if (VERSION.SDK_INT >= VERSION_CODES.O) {
Expand Down

0 comments on commit be1395b

Please sign in to comment.