Skip to content

OnShortcutPress stopped working on web #4552

Closed

Description

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

The key press triggers that were working yesterday aren't today on my web app. The only way to make them work is to log out and log in again. Same behaviour in Test and Run modes.

The only thing that changed is the new ff release.

Expected Behavior

Pressing the relevant key should trigger the action

Steps to Reproduce

  1. Add new OnShortcutPress to a page to launch an alert dialog
  2. Instant reload your test, OnShortcutPress doesn't work
  3. Log out
  4. Log in and OnShortcutPress will work

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

IT40kMnlsMlNm+FR+s2NacFHlgAjKW4VapIFqNlRaCsofePrOpkAf8/7UFtUOM+4Y39IPmf9gTgX/MrXiM7uUvErOSmWGohbyc9hWw3vZEKnVKq7EpS3b0dSGZ1mCh2MyLa3ohV+WcluSl463E+Xe9m+aAHZJufpOFUdReaeXdeK2SrDX1iXc2URm05KZDPz

Visual documentation

Here's a video https://www.dropbox.com/scl/fi/4s3lp69irpdrf8putvgr2/screen-recording-2024-10-24-at-080411_QRfDLB8w.mp4?rlkey=pyv1x9qgbn29mm1e6m1jzkhd6&st=duagva6p&dl=0

Environment

- FlutterFlow version: 5.0.8
- Platform: web
- Browser name and version: Chrome
- Operating system and version affected: MacOS

Additional Information

Activity

  1. ghost added
    status: needs triage
    on Oct 23, 2024
  2. mmearly commented on Oct 24, 2024

    @mmearly

    Hi @andrewbeckley, thanks for reporting this issue. Also thanks for the video -- it really helped clear up some confusion.

    I've done a bit of digging, and it seems to be an issue of focus being properly passed to the project when the test/run session is embedded in an iframe. We use an iframe in test and run mode to wrap the project in our overhead UI (e.g. debug pannel, the window size options). We upgraded from Flutter 3.22 to 3.24 in the most recent FF release and it seems that there are a few known issues on the Flutter side related to this present in 3.24 (issue one, issue two, issue three). This behavior is likely a result of some combination of these issues -- not quite sure exactly which ones yet.

    We'll work on a temporary fix, but unfortunately it's impossible for us to guarantee that we'll be able to resolve the issue fully until Flutter resolves their issues.

    In the meantime, I found two workarounds that seem to reliably work:

    • Use run mode's View Full Screen mode. This way the project does not run in an iframe, so the issue is not present.
    • It is possible to force focus to return to the project by clicking into a text field. If using View Full Screen mode isn't acceptable (probably because you need access to debug pannel), adding a temporary dummy text field to click on to cause the project to start listening for keyboard shortcuts again will let you take focus back when it gets stolen. (I assume that's why logging in fixed the issue -- because you needed to click on text fields to enter the email and password.)
  3. DerLeole commented on Oct 25, 2024

    @DerLeole

    Funnily enough the problem seems to happen in reverse too (at least in firefox, couldnt reproduce in chrome).

    I have a bug with an exported web build from FF that makes text fields unable to receive any keyboard input if you tap on any html element. While it might look like you can reselect the text element (the style changes), it does not receive any actual text input.
    That wouldn't be too bad, but sadly Flutterflow wraps the entirety of the screen in a WebView aware for Fullscreen bottom sheets, and WebViewAwares are just HTML elements which means in the current FF version, if you have a Text Field in a Widget that is used as a pop-up via bottom sheet, you cannot write anything in it, once you clicked anywhere on the screen (including on the text field itself) in Firefox.

    Seems like the new Flutter update majorly messed up some kind of keyboard focus change managment between HTML elements and native elements.

  4. github-actions commented on Nov 2, 2024

    @github-actions

    This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

  5. added and removed
    status: needs triage
    on Nov 8, 2024
  6. leighajarett commented on Nov 8, 2024

    @leighajarett
    Contributor

    We're still investigating to see if there are any workarounds but it seems this may be caused by an underlying Flutter issue: flutter/flutter#155265

  7. github-actions commented on Nov 16, 2024

    @github-actions

    This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

  8. ksokolovskyi commented on Apr 17, 2025

    @ksokolovskyi

    Hi @leighajarett @wenkaifan0720 @mmearly!

    I did an investigation and found that this issue is reproducible in Flutter v3.27.3, but it no longer occurs in Flutter v3.29.3. It was most likely fixed in this Flutter Engine PR: flutter-team-archive/engine#55045

    You can verify the fix using this DartPad: https://dartpad.dev/?id=b82af2394007b747e6a5e977581dab65
    Since DartPad uses an iframe to display the Flutter app, it’s a reliable way to verify that the issue doesn't occur.

    Currently, FlutterFlow uses Flutter v3.27.3, so the issue is still present there. Once FlutterFlow upgrades to v3.29.0 or later, it should be resolved.

    Hope this helps!

  9. wenkaifan0720 commented on Apr 17, 2025

    @wenkaifan0720
    Collaborator

    Thanks for looking into this. We will update our Flutter version in the coming days.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions