-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$2000] Web - Chat -If you click on a chat message, press Esc-message is highlighted with a blue frame #15723
Comments
Triggered auto assignment to @lschurr ( |
Bug0 Triage Checklist (Main S/O)
|
I reproduced this in Chrome. Definitely an odd one. |
Triggered auto assignment to @pecanoro ( |
Job added to Upwork: https://www.upwork.com/jobs/~014f93d9e7848a9dc1 |
Current assignee @lschurr is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Current assignee @pecanoro is eligible for the External assigner, not assigning anyone new. |
I first reported this here https://expensify.slack.com/archives/C049HHMV9SM/p1676142137019119 cc @kbecciv |
I think this issue is related to keyboard navigation or accessibility and they are supposed to be on hold, see the original discussion thread https://expensify.slack.com/archives/C01GTK53T8Q/p1668604822482759 |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
It's how the native elements works. Ref: https://www.github.com/adobe/react-spectrum/issues/2821 (you can test the fiddle on the issue) So, I don't think this is a bug because chat message is focusable. |
ProposalPlease re-state the problem that we are trying to solve in this issue.On web, focused elements are displayed with a blue border when the mouse is not over it. You don't have to do all the steps listed to reproduce this. Proposal.15723-1.movWhat is the root cause of that problem?Pressing Esc focuses the message, which was selected by clicking the mouse.
:focus-visible {
outline: 0;
box-shadow: inset 0px 0px 0px 1px #5AB0FF;
}
What changes do you think we should make in order to solve the problem?Prevent the Esc key from focusing the selected message. I don't have a definite plan to achieve this, but putting this proposal out there just in case it helps someone else find the solution. What alternative solutions did you explore?Removing the box-shadow removes the blue border from being displayed around a focused message when the mouse is not over it.
:focus-visible {
outline: 0;
}
But it is better not to change this, as not showing the blue border around focused objects affects the tab key shortcut also. Proposal.15723-2.mov |
The issue is because of default browser behaviour, it is a normal behaviour which can be fixed. To fix the issue I will add a css rule to remove this behaviour and after that it shouldn't appear again, I have managed to remove the issue on my web developer tool as I will show the issue being elemenated in the screen recoding attached. Untitled.design.mp4 |
📣 @AmjedNazzal! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Format:
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.If you click on a message in the chat, and then press Esc, the message is highlighted with a blue frame. What is the root cause of that problem?The default behavior when pressing Esc after selecting a message, in this case, is to focus on the message by using the :focus-visible CSS styling. What changes do you think we should make in order to solve the problem?To ensure consistency with the behavior of the rest of the app, we need to focus on the input text of the composer when the ESC key is pressed after selecting a message. This can be achieved by adding Screen.Recording.2023-03-09.at.10.06.20.AM.movWhat alternative solutions did you explore? (Optional)No alternative solutions were explored. |
ProposalPlease re-state the problem that we are trying to solve in this issue.When any key not just ESC is pressed on a focused chat list item, this is highlighted, and outine is not consistent. It is good to have it for accessibility, but the issue here is that on hover over the message item, outline is invisible, and when the hover moves to other message, the outline again shows. issue.mp4What is the root cause of that problem?Line 44 in 22cfc7a
There is a slight difference between App/src/pages/home/report/ReportActionItem.js Line 229 in 22cfc7a
The reason it hides outline is that. App/src/pages/home/report/ReportActionItem.js Line 244 in 22cfc7a
This applies a background color, and the outline is invisible (inside this element) What changes do you think we should make in order to solve the problem?App/src/pages/home/report/ReportActionItem.js Line 238 in 22cfc7a
We can blur the focused item when it is hovered. As this will not be focused, there will be no outline. This does no break keyboard accessibility, because it only blurs, if the user moves his cursor, and keyboard is still accessible. <PressableWithSecondaryInteraction
pointerEvents={this.props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? 'none' : 'auto'}
ref={el => this.popoverAnchor = el}
onPressIn={() => this.props.isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
onPressOut={() => ControlSelection.unblock()}
onSecondaryInteraction={this.showPopover}
preventDefaultContentMenu={!this.props.draftMessage}
withoutFocusOnSecondaryInteraction
// add this prop
dataSet={{
type: 'message-item',
}} <Hoverable onHoverIn={() => {
if (!document.activeElement) {
return;
}
if (document.activeElement.dataset.type !== 'message-item') {
return;
}
document.activeElement.blur();
}} What alternative solutions did you explore? (Optional)None Resultfixed.mp4 |
@sobitneupane could you review these proposals? |
ProposalPlease re-state the problem that we are trying to solve in this issue.Clicking a message then pressing the ESC key shows a blue frame. What is the root cause of that problem?The ReportActionItem is focusable where focus-visible style is applied. What changes do you think we should make in order to solve the problem?
I need to explain the behaviour of focusable prop on View:
What alternative solutions did you explore? (Optional)
|
@sobitneupane are you able to take a look at these proposals? |
It looks like a valid issue to me. The focused message is highlighted on pressing any key which is not the expected behavior. I believe the expected behavior here is: the focused message should be highlighted only when pressing "Tab" key. I would like to have @pecanoro's opinion on this. |
@sobitneupane Yes, you are right, it happens when you click all keys, not only Esc! So I agree we should fix that and focusable only on tab |
We are expecting updated proposals. |
@sobitneupane my proposal is aligned with the requirements. |
Focusable elements behave that way, it's not a bug in E/App. Here is a demo, click the button then press any key. Personally I don't see the point of having the message item being focusable since there is no action on pressing the ENTER key. |
I was testing on other apps (Slack) and websites and you are right, no elements besides the ones that we can interact with are focusable. Is there any reason why these were focusable in the first place? |
@pecanoro I'm not really sure but maybe it was unintended since the message item is a |
@sobitneupane What are your thoughts, do you think we can remove the focusable property of it without causing any issues? |
I agree with @s77rt. My first thought was if we remove focus from ReportActionItem IOU Message and Attachments might not be focusable. But turns out it is not the case. Even when |
@mdneyazahmad Thanks for the proposal. The |
@s77rt Thanks for the proposal. Can you please elaborate your proposal.
Can you please add an permalink where you are suggesting this change?
Do we need to make any change in react native web? What sort of changes are required? Please update your proposal and let me know. |
@sobitneupane slack also focuses on message list item, but the navigation there is different than ours. When you press up arrow or down arrow, it focusses the corresponding message, in our case, it scrolls. Selecting prev and next message with arrow is good for accessibility, otherwise it might need multiple Tab to skip messages. When the message list item gets focused, screen reader will read it. focusable-message.mp4 |
Checking @mdneyazahmad uploaded video, I assume that we will implement arrow navigation for messages in the future, so completely removing focus from message items does not look like as a future proof solution. Updating my proposal based on that... |
Proposal |
@pecanoro Can you please confirm that? Are we planning to move with arrow navigation for messages in the near future? I think even if we decide to do so, we can undo the changes. But for now I don't see any reason to keep |
@sobitneupane can you please review my proposal? This will work for both keyboard and mouse users.
I believe, we should not remove something that is already working, and that we may decide to reintroduce in future. |
@mdneyazahmad how did you manage to select the message on Slack? On the mac app, I can't seem to be able to focus it. |
|
That is incredibly odd so you can only focus it if you navigate back but if you navigate forward... That seems like a bug in Slack hahaha However, I tested on WhatsApp and they do let you focus on each message and then go back and down. I am not sure if we will implement arrow navigation any time soon, I couldn't find any convos about it. Maybe we should open an issue for it since the other platforms seem to have it. What I noticed is that, in other apps, when you type a letter, it will just write in the composer but in our case, it just focuses the element, which it's pretty odd. Honestly, the more I look into this, the more I think we should do nothing when it comes to the Esc letter and open another issue to actually fix the problem of typing letters, which should just type in the message composer instead. |
I agree @pecanoro . |
Ok, let's close this one. Thank you everyone for your proposals and sorry for having to close this one. I reported the composer problem in #expensify-bugs here so we can fix that instead. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when executing PR #15650
Action Performed:
Expected Result:
Nothing should happen
Actual Result:
If you click on a message in the chat, press Esc - message is highlighted with a blue frame.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.80.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug5967837_Recording__345.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: