Skip to content

deleteBackward or keyPress event for Textfield #29845

Closed

Description

@vkjon

One of the requirements for the project I am working on currently requires performing an action when delete key is received by the TextField widget. Particularly, there is no way to detect that delete was tapped when there is no text in the TextField.

I'd like to propose an onDelete event, or onKeyPress(keyCode) event, propagation to the end user. Please let me know your thoughts.

Activity

  1. jonahwilliams commented on Mar 23, 2019

    @jonahwilliams
    Contributor

    I believe the soft keyboard on either Android or iOS doesn't actually expose key level events like delete or key press, it only tells us what the current string is.

    For Android, see https://stackoverflow.com/questions/4886858/android-edittext-deletebackspace-key-event.

    cc @gspencergoog

  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    d: stackoverflowGood question for Stack Overflow
    on Mar 24, 2019
  3. vkjon commented on Mar 24, 2019

    @vkjon
    Author

    The engine already taps into UIKeyInput (iOS) and InputConnection (Android), we could leverage this into forwarding keys to the plugin. Sample implementation for iOS in https://github.com/SnowXD/engine/commit/fc5197d101645e001de9d8d50974758282cbb095.

  4. kangfarih commented on May 14, 2019

    @kangfarih

    Is this already implemented for current version?

  5. vkjon commented on May 18, 2019

    @vkjon
    Author

    @kangfarih Nope. I am going to rework it as discussed in the PR. See flutter-team-archive/engine#8606

  6. psyanite commented on Jul 17, 2019

    @psyanite

    I believe this is related to #14809

  7. VladyslavBondarenko commented on Jul 28, 2020

    @VladyslavBondarenko

    Please follow up on #14809, closing as duplicate

  8. github-actions commented on Aug 18, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    d: stackoverflowGood question for Stack Overflowframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions