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

Export palette as a JSON #5

Merged
merged 5 commits into from
Aug 17, 2020
Merged

Export palette as a JSON #5

merged 5 commits into from
Aug 17, 2020

Conversation

ziyafenn
Copy link
Contributor

@ziyafenn ziyafenn commented Aug 14, 2020

Created a function to export palettes as a JSON

Code can be further refactored to reduce the repeats in code. I don't have enough time right now to make it better, probably sometime later.

For time being, it gets its job done.

Also added modal and button components.

#4

@edelstone
Copy link
Owner

Thanks @ziyafenn ! I'll look closer later today.

Playing with it in the browser, I'm wondering if it's possible to control focus a little bit, for example when the dialog opens place focus on the close span, and when it closes, place focus back on export palette button.

If that's relatively simple I'd love to try to get that in there. I'll check the code shortly.

@edelstone
Copy link
Owner

This looks all good @ziyafenn. Let me know if you're interested in trying to get the focus a bit more standard as mentioned above. Otherwise I'll likely merge this and make a new issue.

@ziyafenn
Copy link
Contributor Author

hey @edelstone.
I believe your comments are due to accessibility reasons? If yes, instead of focus, correct tabindex should be implemented. It makes sense to focus on textarea, once modal is open, but in our case it set to readonly, so there is no need to focus in my opinion.

Here is the article from developers.google about focus and tabindex.

I will try now implement the modal in a way, that once it is displayed, first tab will focus on close button.
And on page itself, first tab will focus on export button.

@ziyafenn
Copy link
Contributor Author

ziyafenn commented Aug 16, 2020

I pushed a commit that fixes those issues:

  1. On page, first tab press focuses on export button
  2. On modal, it sets focus automatically on first/last possible element, which in our case is close button. I'm not sure that it is good to autofocus on close, but i wasn't been able to remove that.

PS.
my linter decided to reformat all the code... / added new commit to fix it

@edelstone
Copy link
Owner

Hi @ziyafenn . Thanks for the update, and the overall work.

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.

2 participants