Skip to content

Navigation triggered multiple times on fast taps #1312

Answered by chrisbanes
ateslovan asked this question in Q&A
Discussion options

You must be logged in to vote

A quick way to handle this would be to check the current back stack 'top record', and no-op if it's the same. Something like this:

fun Navigator.goToScreen(screen: Screen, skipIfSame: Boolean = true) {
  if (skipIfSame && peek() == screen) return
  goTo(screen)
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@chrisbanes
Comment options

Answer selected by ateslovan
@ateslovan
Comment options

@ZacSweers
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants