-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[GH-#10878] Fix bug of Getting Start Widget Accept Focus #11807
[GH-#10878] Fix bug of Getting Start Widget Accept Focus #11807
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
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.
Thank you for your contribution 👍
In order to accept your changes please be sure to sure to sign the eclipse contributor agreement (eca) with the same email as your authorship.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
9380f7f
to
9b187a3
Compare
Signed-off-by: White Hsu <[email protected]>
9b187a3
to
83fa879
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@vince-fugnitto got it and thanks! |
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.
@WhiteHsu for reference theia-blueprint
(downstream product) made a change to fix the issue where they could successfully accept the focus:
https://github.com/eclipse-theia/theia-blueprint/pull/201/files
hi @vince-fugnitto Yes I've learned from that, then the Getting Started Widget could be focused now. |
@WhiteHsu I had referenced the
You'll need to modify theia/packages/getting-started/src/browser/getting-started-contribution.ts Lines 51 to 63 in eb4b047
And ensure that |
@vince-fugnitto Ah i see! Sorry for my miss! Thanks a lot for your kind feedback and I'll revise it accordingly! |
Signed-off-by: White Hsu <[email protected]> == To modify getting-started-contribution.ts to pass activate to the openView methods. To focus on the first available link in getting-started-widget.tsx. [Question] But the warning below still exists. May I ask your kind suggestion? Thank you very much. -- WARN Widget was activated, but did not accept focus after 2000ms: getting.started.widget --
ad084fc
to
ca0f332
Compare
Many thanks for your kind feedback. I've revised further but the warning still exist. What I've updated are:
However the warning still there: "WARN Widget was activated, but did not accept focus after 2000ms: getting.started.widget" I've tried to accept focus on many different elements include:
But nether can resolve the warning. May I ask your kind suggestion? Please kindly review my code changes here. Thank you very much. |
@WhiteHsu I believe that only certain elements can actually accept focus based on the following documention:
I believe that in |
@vince-fugnitto Thanks for your kind feedback! Because this bug was mentioning the dysfunctional to highlight the widget after focusing it as the description below, this bug has already been resolved as the functional perspective. Therefore should we close this ticket first, and I can open another ticket to mention the "warning", then it'll be clearer for project management? :-)
|
There are quite a few elements in the Getting Started widget that can accept focus. For example, this might work: this.node.getElementsByTagName('a')[0]?.focus(); That would put focus on the first 'command link' in the widget, which in the browser is |
ah i see @colin-grant-work . thanks for suggestion! I'll try it again on the weekend! |
ca0f332
to
de59f4c
Compare
Thanks for the suggestion @colin-grant-work @vince-fugnitto , and it seems workable with getElementsByTagName('a') to accept focus! Please kindly help review and feedback. Thank you very much! |
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 think this code could be subject to a bug that can be prevented fairly easily.
packages/getting-started/src/browser/getting-started-widget.tsx
Outdated
Show resolved
Hide resolved
de59f4c
to
e59e7e4
Compare
…hub.com:WhiteHsu/theia into bug-10878_Getting_Start_Widget_Not_Accept_Focus == To modify getting-started-contribution.ts to pass activate to the openView methods. To focus on the first available link in getting-started-widget.tsx. ==
e59e7e4
to
0b49087
Compare
Hi @colin-grant-work I've updated codes accordingly also merge the imports to follow Lints. Please kindly help review again. :-) |
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 changes look good to me, and the widget now accepts focus. Once CI is green, I'll merge.
What it does
Closes #10878.
The fix for the bug #10878 to make the Getting Start Widget could be focused.
How to test
Review checklist
Reminder for reviewers
However, the console will still show the warning message:
root WARN Widget was activated, but did not accept focus after 2000ms: getting.started.widget
I've tried many different ways to fire the focus, but no way can resolve this warning message. May I know whether we must resolve the warning, or it should be ok because the Getting Start Widget can be focused properly for now?
Please kindly suggest and feedback. Thank you very much.