Fix autofill for android (flutter/engine#40771)
Fix autofill for android
This commit is contained in:
@@ -388,7 +388,7 @@ public class FlutterView extends FrameLayout
|
||||
setFocusable(true);
|
||||
setFocusableInTouchMode(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS);
|
||||
setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_YES);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,15 @@ public class FlutterViewTest {
|
||||
verify(platformViewsController, times(1)).attachToView(flutterView);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void flutterView_importantForAutofillDoesNotExcludeDescendants() {
|
||||
FlutterView flutterView = new FlutterView(Robolectric.setupActivity(Activity.class));
|
||||
|
||||
// Value should not exclude descendants because platform views are added as child views and
|
||||
// can be eligible for autofill (e.g. a WebView).
|
||||
assertEquals(View.IMPORTANT_FOR_AUTOFILL_YES, flutterView.getImportantForAutofill());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void detachFromFlutterEngine_alertsPlatformViews() {
|
||||
FlutterView flutterView = new FlutterView(Robolectric.setupActivity(Activity.class));
|
||||
|
||||
Reference in New Issue
Block a user