8000 Use details/summary to display keyboard hints in calendar modal by stephanieleary · Pull Request #105 · fymmot/inclusive-dates · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use details/summary to display keyboard hints in calendar modal #105

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

stephanieleary
Copy link
8000

Adds the keyboard shortcuts table as shown in the documentation to the calendar modal in a details element, using the original button as the summary toggle.

Includes new strings for every key, keyboard shortcut description, and the "Key, Action" table headers.

Copy link
vercel bot commented Aug 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
inclusive-dates ❌ Failed (Inspect) Aug 5, 2024 4:34pm

Copy link
Owner
@fymmot fymmot left a comment

Choose a reason for hiding this comment

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

Thank you so much for taking the time to do this PR!

There are a few issues that need to be fixed (the build is currently failing). See my suggestions in the review.

@@ -46,6 +46,31 @@ export type InclusiveDatesCalendarLabels = {
todayButton: string;
yearSelect: string;
keyboardHint: string;
keyboardKeyTab: string;
Copy link
Owner

Choose a reason for hiding this comment

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

There is a missing type here for keyboardKeyShift

@@ -62,6 +87,31 @@ const defaultLab 10000 els: InclusiveDatesCalendarLabels = {
todayButton: "Show today",
yearSelect: "Select year",
keyboardHint: "Keyboard commands",
keyboardKeyTab: "Tab",
Copy link
Owner

Choose a reason for hiding this comment

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

Missing translation here for keyboardKeyShift

</svg>
{this.labels.keyboardHint}
</button>
<details class="{this.getClassName("keyboard-shortcuts")}">
Copy link
Owner
@fymmot fymmot Aug 14, 2024

Choose a reason for hiding this comment

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

A syntax error here, it should be
<details class={this.getClassName("keyboard-shortcuts")}>
(without the quotes)

</button>
<details class="{this.getClassName("keyboard-shortcuts")}">
<summary>
<span class="{this.getClassName("keyboard-hint")}">
Copy link
Owner

Choose a reason for hiding this comment

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

Same here:
<span class={this.getClassName("keyboard-hint")}>

{this.labels.keyboardHint}
</span>
</summary>
<table class="{this.getClassName("keyboard-shortcuts-table")}">
Copy link
Owner

Choose a reason for hiding this comment

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

Same here:
<table class={this.getClassName("keyboard-shortcuts-table")}>

<td>
<kbd>{this.labels.keyboardKeyArrowright}</kbd>
</td>
<td>{this.labels.keyboardShortcutArrowRight}</td>
Copy link
Owner

Choose a reason for hiding this comment

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

This does not match the translation key which uses lower key, causes a Typescript error:
keyboardShortcutArrowright

@@ -322,12 +322,9 @@ inclusive-dates *:focus-visible {
}

.inclusive-dates-calendar__keyboard-hint {
color: var(--secondary-color);
display: flex;
Copy link
Owner

Choose a reason for hiding this comment

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

The <summary> icon does not align.
image

But we might do something like this:

    display: inline-flex;
    transform: translateY(2px);

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
0