Skip to content
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

Close popover on text field tap #1384

Conversation

Cyrine-benabid
Copy link
Contributor

@Cyrine-benabid Cyrine-benabid commented Oct 27, 2022

fixes #1368

@annieappflowy
Copy link
Collaborator

@richardshiue , would you like to help review? This is a fix for your issue

@annieappflowy annieappflowy added grid features related to the table-view database bug Something isn't working labels Oct 28, 2022
@annieappflowy annieappflowy added this to the v0.0.7 milestone Oct 28, 2022
@richardshiue
Copy link
Collaborator

@richardshiue , would you like to help review? This is a fix for your issue

Sure, I'll review when I'm free

@richardshiue
Copy link
Collaborator

Hello @Cyrine-benabid, thanks for contributing and tackling this bug!

Your fix should close the popover correctly, but it's only going to happen by clicking the text field. This means that after I click on "Add option", the unwanted popover wouldn't disappear until I specifically click on the text field, even though the text field already has focus. A better solution would be to listen for focus changes in the popover's elements.

I will try and lay down some steps you can follow to finish this task.

@Cyrine-benabid Cyrine-benabid force-pushed the fix-option_button_doesnt-close_popover branch 2 times, most recently from 65ce212 to 7c99d08 Compare October 29, 2022 14:46
@Cyrine-benabid Cyrine-benabid force-pushed the fix-option_button_doesnt-close_popover branch from 7c99d08 to b7f369b Compare October 29, 2022 14:47
@Cyrine-benabid
Copy link
Contributor Author

Hi @richardshiue ! Thank you for your review and your suggestion ! You can see in the video bellow my idea after the new commits.
If this is not what you're looking for, don't hesitate to inform me.
And thank you very much.
fix_close_popover_on_click.webm

@Cyrine-benabid
Copy link
Contributor Author

Also @richardshiue, this was my original implementation (forgot to push one commit), but I also have a working implementation of your proposition in another commit. Let me know if you think we should use your proposition instead, and I'll push this commit.

@richardshiue
Copy link
Collaborator

Hello @Cyrine-benabid, thanks for the quick update. It solves the bug all right, no doubts there. But doing it the way I outlined above would also allow listening to the popover mutex to unrequest focus from the text field. I don't know that not supporting this will affect the UX much right now, if at all; but could be important if AppFlowy wants to improve keyboard accessibility in the future.

I think it's the perfect time to ask for @appflowy's views. Apart from the above concern, LGTM!

@Cyrine-benabid
Copy link
Contributor Author

Hi @richardshiue, now I understand your point, thank you ! I pushed the implementation you suggested.

@Cyrine-benabid Cyrine-benabid force-pushed the fix-option_button_doesnt-close_popover branch from 74af374 to 1a53a0e Compare October 30, 2022 17:26
@richardshiue
Copy link
Collaborator

Almost there! _AddOptionButton doesn't seem need a popoverMutex either. Also, you can resolve the review comments above when you're done.

@richardshiue
Copy link
Collaborator

LGTM! Thanks for your work and patience with me during this process. Just need AppFlowy team's approval now.

@Cyrine-benabid
Copy link
Contributor Author

Thanks to you @richardshiue for guiding me ! Looking forward to contribute more on this project 🙌 ! Hopefully this PR can be merged or hacktoberfest-accepted today 🙏

@annieappflowy
Copy link
Collaborator

Great work @Cyrine-benabid @richardshiue !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working grid features related to the table-view database hacktoberfest HACKTOBERFEST-ACCEPTED
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug] Grid select option add option textfield doesn't close the type option popover
4 participants