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

fix(dialogs): Focus on the dialog buttons after displaying an alert or confirm #244

Merged
merged 2 commits into from
Jun 22, 2017

Conversation

vitortalaia
Copy link
Contributor

The focus was still placed on the element that triggered the dialog, causing the opening of multiple dialogs when hitting the enter key

Alert

Before

peek 2017-06-22 11-38

After

peek 2017-06-22 11-40

Confirm

Before

peek 2017-06-22 11-39

After

peek 2017-06-22 11-39_0

@codecov-io
Copy link

codecov-io commented Jun 22, 2017

Codecov Report

Merging #244 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #244   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          21     21           
  Lines         409    413    +4     
=====================================
+ Hits          409    413    +4
Impacted Files Coverage Δ
src/js/components/alert.js 100% <100%> (ø) ⬆️
src/js/components/confirm.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3512a3...ec429f2. Read the comment docs.


instance.showConfirm()

expect(spy.calledOnce).to.be.true

Choose a reason for hiding this comment

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

Expected an assignment or function call and instead saw an expression no-unused-expressions


instance.showAlert()

expect(spy.calledOnce).to.be.true

Choose a reason for hiding this comment

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

Expected an assignment or function call and instead saw an expression no-unused-expressions


instance.showConfirm()

expect(spy.calledOnce).to.be.true

Choose a reason for hiding this comment

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

Expected an assignment or function call and instead saw an expression no-unused-expressions


instance.showAlert()

expect(spy.calledOnce).to.be.true

Choose a reason for hiding this comment

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

Expected an assignment or function call and instead saw an expression no-unused-expressions

@vitortalaia vitortalaia force-pushed the fix/focus-on-alert-or-confirm-modals branch from 8e4261d to ec429f2 Compare June 22, 2017 15:18
Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:


Oops! Something went wrong! :(
ESLint couldn't find the plugin "eslint-plugin-chai-friendly". This can happen for a couple different reasons:
1. If ESLint is installed globally, then make sure eslint-plugin-chai-friendly is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm i eslint-plugin-chai-friendly@latest --save-dev
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

beforeEach(() => {
instance.modal = {
show () {},
$content: $('<div><button data-alert-button>Ok</button></div>')
Copy link
Contributor

Choose a reason for hiding this comment

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

só 💅 msm mas não vale passar isso pra uma fixture?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cheguei a pensar nisso, mas vi que em nenhum outro lugar precisava de nada do DOM, aí deixei só aqui mesmo

@vitortalaia vitortalaia merged commit 1f54f70 into master Jun 22, 2017
@vitortalaia vitortalaia deleted the fix/focus-on-alert-or-confirm-modals branch June 22, 2017 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants