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

WIP: pane switching keyboard shortcuts - #1709

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JohnC-80
Copy link
Contributor

This implements keyboard shortcuts to cycle focus through the visible panes in the ui. It will ultimately be set up to focus the first-focusable element within the pane content. If none are available, it will focus the pane header. It will ultimately be set up to allow for a custom focus target within the Pane. This is a prototype. It isn't centralized. The API is guaranteed to change - this is just to see how it feels to use.

Implement shift + pagedown and shift + pageup as pane switchers.

@@ -3,6 +3,7 @@ import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
import queryString from 'query-string';
import { hot } from 'react-hot-loader';
import { getFirstFocusable } from '@folio/stripes-components/util/getFocusableElements';
Copy link
Member

@zburke zburke Oct 4, 2022

Choose a reason for hiding this comment

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

You can import getFirstFocusable directly from @folio/stripes/components; you don't have to reach in and get it by private path.

const modifiedCommands = [...commands,
{
name: 'nextPane',
shortcut: 'shift + pagedown'
Copy link
Member

Choose a reason for hiding this comment

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

FYI, no pagedown or pageup keys on a MacOS laptop keyboard. I know I know, WIP, POC, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for re-iterating this on this rather ancient POC... For persistence of the conversation, Does fn up/down arrow perform the same function/key as pageup/down? can you shift + fn + arrow on a mac?

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

Successfully merging this pull request may close these issues.

2 participants