-
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
Keep input cursor in place when toggling password checkbox #13187
Keep input cursor in place when toggling password checkbox #13187
Conversation
Signed-off-by: someone-here <[email protected]>
Signed-off-by: someone-here <[email protected]>
Signed-off-by: someone-here <[email protected]>
Signed-off-by: someone-here <[email protected]>
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@Julesssss @eVoloshchak One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
I think the linter issue went away because now we are no longer using inline functions... |
Added docstring Co-authored-by: Eugene <[email protected]>
MouseDown doc string Co-authored-by: Eugene <[email protected]>
Removed unused line Co-authored-by: Eugene <[email protected]>
Removed unused line Co-authored-by: Eugene <[email protected]>
Fixed the formatting now. 0 lint errors |
Is this working as expected? |
@@ -291,8 +295,7 @@ class BaseTextInput extends Component { | |||
{this.props.secureTextEntry && ( | |||
<Checkbox | |||
style={styles.secureInputShowPasswordButton} | |||
onPress={this.togglePasswordVisibility} | |||
onMouseDown={e => e.preventDefault()} | |||
onMouseDown={this.togglePasswordVisibility} |
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 can't be working since there is no onPress
handler
Screen.Recording.2022-11-30.at.20.45.29.mov
It just does nothing on native and mWeb
Please test all the platforms every time you open a new PR
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.
In the handler for native(checkbox.native.js), it automatically adds the onPress if it is not present. Or at least it used to....
if (!props.onMouseDown && !props.onPress) { | ||
return; | ||
} | ||
return new Error(`One of "onMouseDown" or "onPress" must be provided in ${componentName}`); |
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.
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.
Android also or iOS only?
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.
And does it work despite the warning?
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.
Android also or iOS only?
All of the platforms
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.
And does it work despite the warning?
No, take a look at this comment
please test everything before opening a PR
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.
Actually, when I did the change during the PR, that is when this bug was introduced. I tested it thoroughly before submitting. In the requiredPropCheck function, the conditions were negated by mistake which caused it to show the error even when the props were set. But anyway, I fixed it and also changed the position of the props spreading to be more reliable. Do you want me to send the videos for any platform 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.
Do you want me to send the videos for any platform again?
No, just verify that it is working
Now, finally it is fixed but I had to disable the eslint warning that forced me to make the breaking change before.... |
When testing for mWeb, please make sure that chrome it updated to the latest version 107 because there might be some internal issues in versions below 102/103 |
Co-authored-by: Eugene <[email protected]>
Co-authored-by: Eugene <[email protected]>
Screen.Recording.2022-12-01.at.16.50.25.movBug in Chrome mWeb |
Please check the chrome version #13187 (comment) |
You are correct, thank you |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2022-12-01.at.16.34.37.movMobile Web - Chrome22-12-01-17-04-03.mp4Mobile Web - SafariScreen.Recording.2022-12-01.at.16.36.50.movDesktopScreen.Recording.2022-12-01.at.16.48.18.moviOSScreen.Recording.2022-12-01.at.16.35.34.movAndroid22-12-01-17-08-26.mp4 |
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.
Looks good and tests well
cc: @Julesssss
Is this PR now ready to merge? |
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.
Testing well for me on all platforms. Thanks for your patience with these PRs.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@Julesssss and @eVoloshchak I want to thank you for being patient with me as I am new to this and you really helped me learn a lot about open-source and best practices for contributing. |
Thank you for saying this! |
And for this job, where can I apply to the upwork posting? |
|
Oh, this is the same one as before. I have already sent a proposal to this job and updated the price as well. |
Can we please fix the PR title to indicate the solved issue or summary of code changes? @eVoloshchak Please make sure you check that. cc: @Julesssss |
import Icon from '../Icon'; | ||
import * as Expensicons from '../Icon/Expensicons'; | ||
|
||
// eslint-disable-next-line rulesdir/prefer-early-return |
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 should have been avoided. Please do not disable Linter warnings unless that is the only option.
e.g.
Here we have to disable the rule. because we want to pass all the generic/default props through.
<BaseCheckbox
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
onMouseDown={props.onMouseDown ? props.onMouseDown : props.onPress}
/>
🚀 Deployed to staging by @Julesssss in version: 1.2.36-0 🚀
|
🚀 Deployed to production by @francoisl in version: 1.2.36-4 🚀
|
@Julesssss @eVoloshchak
Details
Added a checkbox native file that takes care of the events
onMouseDown
andonPress
which seem to be causing this issue.Fixed Issues
$ #12018
PROPOSAL: #12018 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots/Videos
Web
Chrome-arm64.mov
Mobile Web - Chrome
Chrome-mobile.mp4
Web - Safari
Safari.mov
Desktop
desktop.mov
iOS
iOS.mov
Android
Android.mov