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

Add opts.disabled for the Dashboard #2768

Merged
merged 8 commits into from
Feb 26, 2021
Merged

Add opts.disabled for the Dashboard #2768

merged 8 commits into from
Feb 26, 2021

Conversation

arturi
Copy link
Contributor

@arturi arturi commented Feb 15, 2021

  • Disables drag-drop
  • Disables pointer events
  • Everything grayed out

Screenshot 2021-02-15 at 13 05 05

@nqst what do you think?

Closes #1530

@arturi arturi requested a review from nqst February 15, 2021 13:06
@nqst
Copy link
Contributor

nqst commented Feb 17, 2021

Nice! I slightly modified this:

  • Disabled the user-select
  • Added cursor: not-allowed
  • Reduced the overall opacity of the Dashboard (so it doesn't look so active)
  • Set an equal color for all provider icons¹ (thx @kvz for the idea).

¹ Note: I had to add classes to index.js of every provider plugin to make it work.

@@ -502,6 +504,12 @@ module.exports = class Dashboard extends Plugin {
}
}

disableAllFocusableElements = (disable) => {
const focusableNodes = toArray(this.el.querySelectorAll(FOCUSABLE_ELEMENTS))
focusableNodes.forEach(node => node.setAttribute('tabindex', disable ? '-1' : '0'))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@goto-bus-stop what do you think of this? I’ve checked and we mostly have tabindex=0 on FOCUSABLE_ELEMENTS, nothing else is used, so not worth storing the previous value before changing it to -1?

P.S. TIL “The maximum value for tabindex is 32767”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method to disable / enable the Uppy drag/drop and browse
2 participants