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 Users to Tab Through Hues #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ class MaterialColors {

let $hue = $('<div>')
.addClass(`${this.CLASS_NAMES.hue} ${this.CLASS_NAMES.hue}-${hueName}`)
.click(() => this._selectHue(hueName))
.focus(() => this._selectHue(hueName))
.attr('tabindex', '0')
.appendTo(this.$sidebar);

let $hueIcon = $('<div>')
Expand Down Expand Up @@ -378,7 +379,9 @@ class MaterialColors {
.contextmenu(event => {
event.preventDefault();
this._showValueContextMenu(value.hex, value.hueName, value.valueName, value.alpha);
});
$('.is-selected').focus(); // Return focus to the selected hue
})
.click(event => $('.is-selected').focus()); // Return focus to the selected hue

let $hex = $('<div>')
.addClass(this.CLASS_NAMES.colorTileHex)
Expand Down
1 change: 1 addition & 0 deletions app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ body {
position: relative;
flex: 1 0 0;
cursor: pointer;
outline: none;
@include nodrag;

display: flex;
Expand Down
1 change: 0 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" />
</svg>
</div>

<script src="app.js"></script>
</body>
</html>