Skip to content

Conversation

@jpnurmi
Copy link
Member

@jpnurmi jpnurmi commented Jun 4, 2021

TextInputType.none makes it possible to disable the virtual keyboard for individual TextFields, and lays the foundations for custom in-app virtual keyboards (#76072).

This is just the framework part that merely introduces the TextInputType.none enum value. For the actual functionality, the engine needs to be adapted for all platforms to respect TextInputType.none when passed in the text input configuration.

Closes: #83567

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • All existing and new tests are passing.

TextInputType.none makes it possible to disable the virtual keyboard
for certain TextFields, and lays the foundations for custom in-app
virtual keyboards (flutter#76072).

Ref: flutter#83567
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll hold off until the engine changes are LGTM'd.

@jpnurmi
Copy link
Member Author

jpnurmi commented Jun 29, 2021

I suppose there's not much we can do on Windows at this point. TextInput.show and TextInput.hide do nothing: https://github.com/flutter/engine/blob/2384128a226c6661844c247a31204235372a81e6/shell/platform/windows/text_input_plugin.cc#L148. There seems to be a ticket about it: #36057

@jpnurmi
Copy link
Member Author

jpnurmi commented Jun 29, 2021

On macOS, the Accessibility Keyboard is a persistent floating top-level window, and its visibility is controlled by the user. So nothing to do on macOS either?

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Looks like the analyzer is down or something? It's not able to run.

Edit: Windows and Mac seem ok to me also. I would think it's desired that the user can still control an accessibility keyboard even if a Mac app has implemented a custom virtual keyboard using this feature.

@LongCatIsLooong
Copy link
Contributor

@jpnurmi Could you try merging/rebasing the branch to the tip of the tree?

@taosif7-dreamorbit
Copy link

If keyboardType is given TextInputType.none and autofocus is true, it doesn't let enter any text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TextInputType.none

6 participants