Skip to content

Commit

Permalink
When clearing press state, also cancel pending input events
Browse files Browse the repository at this point in the history
Reviewed By: pasqualeanatriello

Differential Revision: D14346275

fbshipit-source-id: 8be56478b2c067b7dd9a186288b460f60d2a1d75
  • Loading branch information
astreet authored and facebook-github-bot committed Mar 7, 2019
1 parent 2e2ab80 commit 451e8b4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.facebook.litho;

import android.os.Build;
import com.facebook.litho.config.ComponentsConfiguration;

/**
Expand All @@ -33,6 +34,9 @@ public void release(Object item) {

if (ComponentsConfiguration.clearComponentHostPressState) {
host.setPressed(false);
if (Build.VERSION.SDK_INT >= 19) {
host.cancelPendingInputEvents();
}
}

super.release(item);
Expand Down

0 comments on commit 451e8b4

Please sign in to comment.