-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Defocus iframe on blur or mouseout (#22153) #22154
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
Conversation
playground/frontend/lib/main.dart
Outdated
| */ | ||
|
|
||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_issue_106664_workaround/flutter_issue_106664_workaround.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
The workaround: If not in iframe, do nothing. If Safari, do nothing because it is not affected. If in Firefox, programmatically release focus on iframe's Otherwise programmatically release focus on iframe's |
|
All set, ready for review. |
|
I also took this chance to rename I did it in this branch because it is likely the fastest way to deploy it, and we want this change before URLs start to spread. |
0b1fb71 to
98ad960
Compare
damondouglas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexeyinkin Thank you for doing this work.
playground/frontend/pubspec.yaml
Outdated
| # the latest version available on pub.dev. To see which dependencies have newer | ||
| # versions available, run `flutter pub outdated`. | ||
| dependencies: | ||
| akvelon_flutter_issue_106664_workaround: ^0.1.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of publishing a package on pub.dev, could you create a local one and reference? One could also reference a depedency via local or GitHub references: https://dart.dev/tools/pub/dependencies. If a pub package is absolutely needed, I noticed two issues flagged in the scores: https://pub.dev/packages/akvelon_flutter_issue_106664_workaround/score
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how I compare these options:
Local package in Beam repo, referenced in pubspec.yaml by relative path
++ Totally under Apache's control.
-- Low chance that anyone will update the code if the behavior of the bug changes in some Flutter versions or browsers since people will just forget about the issue.
In-project code
Same as above, but
-- Even less chance anyone will update the code since there is even no hint in pubspec.yaml that this is a issue.
-- The import of dart:html produces a linter warning ("Avoid web libraries in non-web packages") that has to be silenced. This is one of the reasons I like outsourcing it to dedicated packages so the main code is platform-agnostic and warning-free.
-- Cannot be reused in ToB or other projects even within the same Beam repository.
Git repo, referenced by URL in pubspec.yaml
++ Can be reused in ToB (should it go in Flutter) or even other apps outside of Beam repository.
++ Higher chance of receiving updates since it is a separate unit at Akvelon.
-- The least robust way from Apache's perspective since the repository can be removed, or hidden, or the branch can be force-pushed into a broken state.
Pub.dev package
All benefits of the above, and
++ Package will always be there since pub.dev does not allow to change or delete what was published, unlike git.
++ Highest chance of receiving updates since 3rd parties will adopt this too.
++ Notification when the bug is fixed. Pub.dev packages can be flagged as discontinued, and this will produce a warning on Playground build. It will hint the Playground maintainers to remove the package which will improve user experience (no selection losses on mouse out).
So pub.dev package is not necessary, but I see it as the most beneficial way to all parties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the package. It now have the max score, and the source is public here:
https://github.com/akvelon/flutter-issue-106664-workaround
damondouglas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pabloem This LGTM. However, could you look closely at the use of a published package? I'm on the fence about it. The reasoning seems well thought out but I wanted your opinion as well.
|
fair enough. I'll merge this for now. |
|
I'm thinking it might make sense to eventually separate the Beam Playground into its own repository to isolate these issues from the main repo |


Fixes #22153
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.