-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$1000] BUG: Web/Safari - Opening the protect PDF modal and pressing TAB doesn’t focus on download/close button reported by @dhairyasenjaliya #12010
Comments
Triggered auto assignment to @MitchExpensify ( |
How do you send a protected PDF exactly @kavimuru ? |
@MitchExpensify Added using add attachment from the compose box. |
@MitchExpensify Do you need help with a password protected PDF? I can create one for you. |
Thanks @JmillsExpensify , I figured it out! I am able to reproduce this on Safari - Labeling external as this is a contained front end issue |
Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Triggered auto assignment to @deetergp ( |
Waiting for proposals |
@deetergp, @sobitneupane, @MitchExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@deetergp, @sobitneupane, @MitchExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Waiting for proposals |
Doubled! |
@s77rt Thanks for your proposal. Few Questions: |
Yes, the proposed fix does more harm than good. And as i said it's not effective, you can bypass the fix simply by pressing TAB.
Yes, the second issue is caused by how Safari works, this is a very known behaviour on Safari. Possible fixes:
|
@s77rt It is an expected behavior #7853 (comment):
Fix of this issue should not recreate the other issue. |
The discussion on #7853 is conflicting.
IMHO, solutions that are based on blurring the event.target or event.relatedTarget are bad and will likely cause a lof of trouble Not every issue is a valid issue, and not every fix is a valid fix. |
Yeah. I totally agree with you that the onKeyDown event listener is causing the issue. |
Proposal (Updated)diff --git a/src/components/PDFView/PDFInfoMessage.js b/src/components/PDFView/PDFInfoMessage.js
index 5d583db40..898983f13 100644
--- a/src/components/PDFView/PDFInfoMessage.js
+++ b/src/components/PDFView/PDFInfoMessage.js
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-import {View} from 'react-native';
+import {View, Pressable} from 'react-native';
import Text from '../Text';
import TextLink from '../TextLink';
import Icon from '../Icon';
@@ -29,9 +29,11 @@ const PDFInfoMessage = props => (
<Text>{props.translate('attachmentView.pdfPasswordForm.infoText')}</Text>
<Text>
{props.translate('attachmentView.pdfPasswordForm.beforeLinkText')}
- <TextLink onPress={props.onShowForm}>
- {` ${props.translate('attachmentView.pdfPasswordForm.linkText')} `}
- </TextLink>
+ <Pressable onPress={props.onShowForm}>
+ <Text style={[styles.link]}>
+ {` ${props.translate('attachmentView.pdfPasswordForm.linkText')} `}
+ </Text>
+ </Pressable>
{props.translate('attachmentView.pdfPasswordForm.afterLinkText')}
</Text>
</View>
diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js
index 27302710b..84febd28d 100644
--- a/src/pages/home/report/ReportActionItem.js
+++ b/src/pages/home/report/ReportActionItem.js
@@ -73,6 +73,7 @@ class ReportActionItem extends Component {
this.popoverAnchor = undefined;
this.state = {
isContextMenuActive: ReportActionContextMenu.isActiveReportAction(props.action.reportActionID),
+ isFocusableVisible: false,
};
this.checkIfContextMenuActive = this.checkIfContextMenuActive.bind(this);
this.showPopover = this.showPopover.bind(this);
@@ -85,7 +86,8 @@ class ReportActionItem extends Component {
|| this.props.hasOutstandingIOU !== nextProps.hasOutstandingIOU
|| this.props.shouldDisplayNewIndicator !== nextProps.shouldDisplayNewIndicator
|| !_.isEqual(this.props.action, nextProps.action)
- || this.state.isContextMenuActive !== nextState.isContextMenuActive;
+ || this.state.isContextMenuActive !== nextState.isContextMenuActive
+ || this.state.isFocusableVisible !== nextState.isFocusableVisible;
}
componentDidUpdate(prevProps) {
@@ -168,10 +170,15 @@ class ReportActionItem extends Component {
onPressOut={() => ControlSelection.unblock()}
onSecondaryInteraction={this.showPopover}
preventDefaultContentMenu={!this.props.draftMessage}
- onKeyDown={(event) => {
- // Blur the input after a key is pressed to keep the blue focus border from appearing
- event.target.blur();
+ onKeyDown={(e) => {
+ if (e.key === "Tab") {
+ this.setState({isFocusableVisible: true});
+ } else {
+ this.setState({isFocusableVisible: false});
+ }
}}
+ onFocus={() => this.setState({isFocusableVisible: true})}
+ style={this.state.isFocusableVisible ? {} : styles.noSelect}
>
<Hoverable resetsOnClickOutside>
{hovered => ( Details (Updated)The issue #7853 addresses only SHIFT key but it actually applies to every key. I would say #7853 is a valid issue after all. However the proposed fix on #8443 is problematic. This fixes this issue, #7853, #12058, #12554, and possibly other Safari related issues |
Heads up, we are fixing the Tab key focus on cc: @sobitneupane |
Thanks @parasharrajat. |
@s77rt Your proposal does not completely solve the issue. On tabbing, the focus must rotate among download, close and enter the password. Expected -> Download -> Close -> Enter the password -> Download ... Screen.Recording.2022-11-14.at.18.27.07.movIs there any way to get rid of |
@sobitneupane And that's the behaviour I'm getting on Safari 16.0 and on other browsers too.
What issues? The current implemented onKeyDown is causing a lot of issues due to Please retest |
I am testing it on v1.2.27-3. Can you please test it on latest version. |
Why is this expected behavior?
This should be the expected behavior
|
Also please update your proposal based on #12010 (comment)
Your proposal has some conflict with the accepted proposal in the othe issue. |
@sobitneupane By the way, the lost focus issue is a regression and it's effecting all the browsers |
regression from #12391 |
Then we should get rid of this regression first. Reported here |
#12718 might solve the issue. Will test once it is merged. |
@sobitneupane I don't know if this is still a valid issue
I don't know if my proposals are eligible anymore, but I think finding the root cause and deducting that issue is caused by two separate issue have a value |
@deetergp, @sobitneupane, @MitchExpensify Eep! 4 days overdue now. Issues have feelings too... |
Based on an internal discussion I am closing this issue because it relates to tab navigation is more accurately a new feature versus being a bug. I've place it on the accessibility milestone so it can be picked up down the road! |
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. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
On pressing TAB should first focus on Download icon, pressing TAB again should focus on Close Icon (just like chrome)
Actual Result:
On pressing TAB it directly focus on enter the password (makes modal un-usable while app is on accessibility)
Workaround:
unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.18-1
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Screen.Recording.2022-10-19.at.8.56.29.AM.mov
Recording.30.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhairyasenjaliya
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1666150625899149
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: