Skip to content

Conversation

@OlimpiaZurek
Copy link

@OlimpiaZurek OlimpiaZurek commented Apr 12, 2023

Original issue: $Expensify/App#16353

This PR changes implementation on Keyboard dismiss inside togglePicker method. In current implementation Keyboard.dismiss() is called immediately, which can caused issues ( eg. Expensify/App#16353).
I added listener keyboardDidHide and open modal if the Keyboard appears. Otherwise just open modal.

@0xmiros
Copy link

0xmiros commented Apr 12, 2023

@danieldoglas when user currently focuses on input and select picker and close picker, should we focus back to original input?

@danieldoglas
Copy link

@0xmiroslav I don't think we should go back to the original input, we should just close.

I'm addressing internally why I can't assign you to this PR, I think we have some permission issues here. Will get back to you soon.

@danieldoglas
Copy link

@0xmiroslav can you try to review this PR without me assigning you?

@0xmiros
Copy link

0xmiros commented Apr 12, 2023

@0xmiroslav can you try to review this PR without me assigning you?

Sure thing

Copy link

@0xmiros 0xmiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code mostly looks good. Just minor feedback:

src/index.js Outdated

if (Keyboard.isVisible()) {
const keyboardListener = Keyboard.addListener('keyboardDidHide', () => {
this.updatePickerState(animate,postToggleCallback);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.updatePickerState(animate,postToggleCallback);
this.updatePickerState(animate, postToggleCallback);

src/index.js Outdated
Keyboard.dismiss();
}
else {
this.updatePickerState(animate,postToggleCallback);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.updatePickerState(animate,postToggleCallback);
this.updatePickerState(animate, postToggleCallback);

src/index.js Outdated
Comment on lines 298 to 299
}
else {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
else {
} else {

@OlimpiaZurek
Copy link
Author

all comments have already been resolved

@0xmiros
Copy link

0xmiros commented Apr 17, 2023

@OlimpiaZurek please pull from master and fix lint. Not related to this PR but asking since you also worked on #9.

- const preserveSpaces = (label) =>  {
+ const preserveSpaces = (label) => {
    return label.replace(/ /g, '\u00a0');
-  }
+ }

And it would be good to add some automated tests.

@OlimpiaZurek
Copy link
Author

@OlimpiaZurek please pull from master and fix lint. Not related to this PR but asking since you also worked on #9.

- const preserveSpaces = (label) =>  {
+ const preserveSpaces = (label) => {
    return label.replace(/ /g, '\u00a0');
-  }
+ }

And it would be good to add some automated tests.

done

Copy link

@0xmiros 0xmiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, tests well, automated tests pass.
Checklist will be done in app PR.
cc: @danieldoglas

@danieldoglas danieldoglas merged commit dabfcd5 into Expensify:master Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants