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

25052021 share focus mngmnt #5146

Merged
merged 1 commit into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions changelog/unreleased/enhancement-people-focus
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Enhancement: Send focus to "Add people" btn after closing Add/Edit panels

We've started sending the focus to "Add people" button after the Add or Edit panels in the people accordion have been closed.
We've started sending the focus to "Add people" button after the `Add` panel in the people accordion has been closed.
Also, when editing a share the focus jumps back to the "Edit" button in the respective share after cancelling or
confirming the action.

https://github.com/owncloud/web/pull/5129
https://github.com/owncloud/web/pull/5129
https://github.com/owncloud/web/pull/5146
20 changes: 17 additions & 3 deletions packages/web-app-files/src/components/FileSharingSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@
v-if="$_ocCollaborators_canShare && currentPanel === PANEL_NEW"
key="new-collaborator"
@close="$_ocCollaborators_showList"
@beforeDestroy="toggleCollaboratorNew"
@mounted="toggleCollaboratorNew"
/>
<edit-collaborator
v-if="$_ocCollaborators_canShare && currentPanel === PANEL_EDIT"
key="edit-collaborator"
:collaborator="currentShare"
@close="$_ocCollaborators_showList"
@beforeDestroy="toggleCollaboratorEdit"
@mounted="toggleCollaboratorEdit"
/>
</div>
</template>
Expand Down Expand Up @@ -363,6 +367,19 @@ export default {
this.currentShare = share
this.SET_APP_SIDEBAR_ACCORDION_CONTEXT(PANEL_EDIT)
},
toggleCollaboratorNew(component, event) {
this.toggleCollaborator(component, event, '#oc-sharing-autocomplete')
},
toggleCollaboratorEdit(component, event) {
this.toggleCollaborator(component, event, '#files-collaborators-role-button')
},
toggleCollaborator(component, event, selector) {
this.focus({
from: document.activeElement,
to: component.$el.querySelector(selector),
revert: event === 'beforeDestroy'
})
},
$_ocCollaborators_deleteShare(share) {
this.transitionGroupActive = true
this.deleteShare({
Expand All @@ -373,9 +390,6 @@ export default {
$_ocCollaborators_showList() {
this.SET_APP_SIDEBAR_ACCORDION_CONTEXT(PANEL_SHOW)
this.currentShare = null
this.$nextTick(() => {
this.$refs.addCollaborators.$el.focus()
})
},
$_ocCollaborators_isUser(collaborator) {
return (
Expand Down