Skip to content

Commit

Permalink
Ship suppress focus while mounting experiment
Browse files Browse the repository at this point in the history
Summary: While we are mounting, we should trigger focus traversal in the Android View hierarchy.

Reviewed By: muraziz

Differential Revision: D14149361

fbshipit-source-id: e13df326f61b3da4cd6a13843d6f9136f1a2ac08
  • Loading branch information
marco-cova authored and facebook-github-bot committed Feb 20, 2019
1 parent ad899e4 commit d93e2e0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -972,10 +972,6 @@ public void invalidate() {

@Override
public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
if (!ComponentsConfiguration.suppressFocusRequestWhileMounting) {
return super.requestFocus(direction, previouslyFocusedRect);
}

// Arguments for equivalent call to View.requestFocus().
final boolean nullArgumentsRequestFocusCall =
(direction == View.FOCUS_DOWN && previouslyFocusedRect == null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ public class ComponentsConfiguration {
/** set the size of the extra memory internal node tree should take */
public static int extraMemorySize = 0;

/** If true, it's going to suppress getRootView().requestFocus() calls during mounting. */
public static boolean suppressFocusRequestWhileMounting = false;

/**
* Controls if DisplayList wrapping should be disabled by default. Would have no effect if
* ComponentTree explicitly set up to enable wrapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,6 @@ public void testSuppressInvalidationsWithRect() {

@Test
public void testSuppressRequestFocus() {
ComponentsConfiguration.suppressFocusRequestWhileMounting = true;

mHost.requestFocus();
assertThat(mHost.getFocusRequestCount()).isEqualTo(1);

Expand All @@ -624,8 +622,6 @@ public void testSuppressRequestFocus() {
mHost.suppressInvalidations(false);

assertThat(mHost.getFocusRequestCount()).isEqualTo(2);

ComponentsConfiguration.suppressFocusRequestWhileMounting = false;
}

@Test
Expand Down

0 comments on commit d93e2e0

Please sign in to comment.