Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[web] Add support for new line adding in a multiline field with non-default action. #167952

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ksokolovskyi
Copy link
Contributor

In the current web implementation, when the user presses the Enter key in a multiline text field with non newline input action, the field gets submitted no matter Alt, Control, or Shift is pressed.

This PR adds the ability to make a new line without submission in a multiline text fields by using the Shift+Enter combination.

Fixes #167902

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. platform-web Web applications specifically labels Apr 28, 2025
@ksokolovskyi ksokolovskyi changed the title [web] Add support to add a new line in multiline field with non-default action. [web] Add support for new line adding in a multiline field with non-default action. Apr 29, 2025
@kevmoo
Copy link
Contributor

kevmoo commented Apr 29, 2025

I wonder if this option should be made opt-in. I'll leave it to the framework folks...

@kevmoo
Copy link
Contributor

kevmoo commented Apr 29, 2025

We should be careful about creating behavior that differs from other (desktop) platforms

@justinmc
Copy link
Contributor

justinmc commented May 1, 2025

I think it makes sense to make this opt-in. I've seen both behaviors in native web apps (cmd+enter submits or not in a multiline field). So I'm thinking Flutter should be configurable as well if I'm understanding correctly.

CC @mdebbar

@ksokolovskyi
Copy link
Contributor Author

@kevmoo @justinmc thanks a lot for taking a look at this PR!
I am wondering how we could make this behavior opt-in from the framework side πŸ€”. I would appreciate it if you could suggest any options.

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 engine flutter/engine repository. See also e: labels. platform-web Web applications specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[web] There seems to be no way for a user to manually enter a newline into a TextField on the web
3 participants