Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-24378 MM-24430 Inteactive dialog improvments #5379

Merged
merged 4 commits into from
May 5, 2020

Conversation

crspeller
Copy link
Member

Summary

  • Interactive dialogs will focus the first field allowing for immediate text entry if the first field is a text field.
  • Interactive dialogs will submit on enter if enter pressed in a text field.
  • Focus will be on the submit button if there are no fields in the interactive dialog, allowing immediate submission.

Ticket Link

https://mattermost.atlassian.net/browse/MM-24378
https://mattermost.atlassian.net/browse/MM-24430

@crspeller crspeller added 1: PM Review Requires review by a product manager 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Apr 22, 2020
@crspeller crspeller removed the 1: PM Review Requires review by a product manager label Apr 22, 2020
return (
<DialogElement
autoFocus={index === 0}
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

@cpoile cpoile removed the 2: Dev Review Requires review by a core commiter label Apr 23, 2020
@cpoile
Copy link
Member

cpoile commented Apr 23, 2020

@crspeller Not sure who from QA should be assigned?

@saturninoabril saturninoabril requested review from saturninoabril and removed request for lindalumitchell April 25, 2020 04:52
@saturninoabril
Copy link
Member

@crspeller Sorry for the delay, just need to prioritize other issue.

I did testing on the ff:

  • dialog without elements (cancel and submit only) - focus not on either button
  • dialog with boolean element only and cancel/submit buttons - focus not on those items
  • dialog with several elements - no focus inside the modal

Key press (enter or other) after opening a modal does nothing.

Also, we have E2E for interactive dialog at https://github.com/mattermost/mattermost-webapp/tree/master/e2e/cypress/integration/interactive_dialog. Would be good to add related test or I can add separately if you wish.

@crspeller
Copy link
Member Author

@saturninoabril Not entirely sure on how to parse your report there.

The bulleted points sound like what I would expect.

Key press (enter or other) after opening a modal does nothing.

In what context? If there are no elements or if there is a text element, enter should submit the modal.

Would be good to add related test or I can add separately if you wish.

I don't have experience with our procedures around e2e testing. Does QA typically add the tests to the PR or separately?

@saturninoabril
Copy link
Member

  1. Dialog without elements (cancel and submit only) - enter didn't submit the modal

Screen Shot 2020-04-29 at 12 31 32 AM

  1. Dialog with boolean element only and cancel/submit buttons - I was expecting for the checkbox to have focus, and on keypress to spacebar, I thought the checkbox will toggle but it didn't happen.

Screen Shot 2020-04-29 at 12 29 40 AM

  1. Dialog with several elements - on press to letters/numbers, nothing happened. I thought that should type into the first textbox.

Screen Shot 2020-04-29 at 12 43 46 AM

For writing E2E, we are requesting for the submitter to add it but we can help out either on the PR itself or separately.

@crspeller
Copy link
Member Author

@saturninoabril

  1. I do not see this.
  2. I added code to make this happen (not part of the original ticket but it's easy)
  3. When I test this it will focus the first textbox.

I noticed when trying to write cypress tests that cypress does not seem to handle the focus properly. It also doesn't seem to handle pressing enter properly. I see 1, and 3 but only in cypress. I will leave that problem to you.

Copy link
Member

@saturninoabril saturninoabril left a comment

Choose a reason for hiding this comment

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

Thanks for checking. Tested and passed. I'll handle related test on separate PR.

@saturninoabril saturninoabril added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels May 5, 2020
@saturninoabril saturninoabril merged commit 9890827 into master May 5, 2020
@saturninoabril saturninoabril deleted the mm-24378-inteactive-dialog-improvments branch May 5, 2020 10:09
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels May 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants