-
Notifications
You must be signed in to change notification settings - Fork 28.6k
iOS keyboard cannot switch brightness automatically #167512
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
Comments
Does anyone know if there happens to be a native iOS API that would let us update the brightness of the keyboard? I'm doubting it, in which case we probably need to hide and reshow the keyboard. Maybe resetting the text input connection when the system brightness changes is the solution. I tried this with a Flutter app on Android and the keyboard always hid itself when leaving and returning to the Flutter app (even without changing the brightness, likely a bug itself). But that meant that Android did not experience this bug directly. It may be possible to work around this by clearing focus when didChangePlatformBrightness? |
Interesting. On the iOS Notes app, the keyboard brightness updates immediately if I change the OS brightness. I wonder what Flutter is doing to prevent this. Perhaps this is another bug that @LongCatIsLooong's go/flutter-textinputplugin-uitextview prototype might fix?
It looks like iOS's logic to receive brightness changes is here: flutter/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm Lines 2210 to 2226 in b9abb56
We could update this such that when the brightness changes, the view controller tells the engine's text input plugin to hide the keyboard if it is visible. |
Uh oh!
There was an error while loading. Please reload this page.
Related to b/411543118
Steps to reproduce
TextField
and the keyboard shows up with correct brightness.Expected results
The keyboard should show dark brightness.
Actual results
The keyboard still shows light brightness unless we close it and then reopen.
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
Screen.Recording.2025-04-21.at.3.00.05.PM.mov
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
[Paste your output here]
The text was updated successfully, but these errors were encountered: