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

Allow navigation through edit via Tab-Key #427

Merged
merged 2 commits into from
Jun 16, 2020

Conversation

jotoeri
Copy link
Member

@jotoeri jotoeri commented May 30, 2020

This one enables to navigate between questions via tab-key and enables edit-mode when entering a question.
Fixes #416 partially, second part for proper navigation on the actions-menu needs to be done on vue (nextcloud-libraries/nextcloud-vue#1126).

@jotoeri jotoeri added bug Something isn't working 3. to review Waiting for reviews feature: 📑 form creation labels May 30, 2020
@jotoeri jotoeri added this to the 2.0 milestone May 30, 2020
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2020

Codecov Report

Merging #427 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #427   +/-   ##
========================================
  Coverage      0.00%   0.00%           
  Complexity      196     196           
========================================
  Files            17      17           
  Lines          1063    1063           
========================================
  Misses         1063    1063           

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 8779ded...fd8f1aa. Read the comment docs.

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Only small fix needed as discussed, ref my review in the Vue components pull request :) nextcloud-libraries/nextcloud-vue#1126 (comment)

@jotoeri
Copy link
Member Author

jotoeri commented Jun 9, 2020

Copied from vue-PR:

  • If the question title is empty (but there are answers) it’s not possible to Tab into the answers, only into the question title field. Guess because the question is already editable, somehow the edit mode doesn’t get triggered for the whole set?
  • Shift-Tabbing into answers from a previous question doesn’t seem to work?

@jotoeri jotoeri added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 9, 2020
@jotoeri jotoeri force-pushed the fix/tabindex_question branch 5 times, most recently from 3b9a0ec to 96e2463 Compare June 10, 2020 19:30
@jotoeri jotoeri added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 10, 2020
@jotoeri
Copy link
Member Author

jotoeri commented Jun 10, 2020

Works now - feels a bit strange, and the relatedTarget is marked as experimental, but should work on most browsers.

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Works very nicely now! :)

@jancborchardt
Copy link
Member

@nextcloud/accessibility if anyone is interested in giving this another review, please check. :)

@jancborchardt
Copy link
Member

Ooops, conflicts because of another merge again @jotoeri, so sorry about that. :( Luckily the mountain of pull requests is soon scaled. :)

@jotoeri
Copy link
Member Author

jotoeri commented Jun 11, 2020

😅 Arghh.

Some code-review would also be good... @juliushaertl maybe? 🙃😊

Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

👍 🐘

@jancborchardt jancborchardt merged commit 9587350 into master Jun 16, 2020
@jancborchardt jancborchardt deleted the fix/tabindex_question branch June 16, 2020 13:18
Comment on lines +158 to +164
if (document.activeElement?.parentNode?.classList.contains('question__item--last')) {
this.$nextTick(() => {
if (this.$refs.inputNewAnswer) {
this.$refs.inputNewAnswer.focus()
}
})
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry, I'm really not ok with this kind of code here.
Querying classes is really an anti-pattern to vue apps here as any change have a high risk of getting forgotten.

@skjnldsv
Copy link
Member

Break the multiple choice question for me.
I cannot add a new one and add the first question.

I will revert this pr I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working feature: 📑 form creation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to edit questions/answers with keyboard only after initial writing
5 participants