Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in comment for TextView.editorActions(handled: (Int) -> Boolean = AlwaysTrue) #559

Open
hetoug opened this issue Jul 2, 2021 · 0 comments

Comments

@hetoug
Copy link

hetoug commented Jul 2, 2021

The comment states that:

 * @param handled Predicate invoked each occurrence to determine the return value of the
 * underlying [TextView.OnEditorActionListener].

But the code seems to use the handler predicate to filter the events and always returns true when the event is sent to the observer:

      try {
        if (!isDisposed && handled(actionId)) {
          observer.onNext(actionId)
          return true
        }
      } catch (e: Exception) {
        observer.onError(e)
        dispose()
      }

      return false

Perhaps two predicates? One for the filtering and one for the return value.

Or at least a fix for the comment.

The same issue is found in TextView.editorActionEvents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant