Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

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

@hetoug

Description

@hetoug

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions