Skip to content

dbeaver/pro#8402 feat: enable checkbox selection via keyboard in Team…#4445

Open
SychevAndrey wants to merge 2 commits into
develfrom
8402-cb-checkbox-is-not-selectable-via-keyboard
Open

dbeaver/pro#8402 feat: enable checkbox selection via keyboard in Team…#4445
SychevAndrey wants to merge 2 commits into
develfrom
8402-cb-checkbox-is-not-selectable-via-keyboard

Conversation

@SychevAndrey

Copy link
Copy Markdown
Contributor

…s and Users tables

@SychevAndrey SychevAndrey self-assigned this Jul 1, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment on lines +46 to +59
function handleHeaderKeyDown(event: DataGridCellKeyboardEvent) {
if (!selection || selection.keys.length === 0 || (event.key !== 'Enter' && event.key !== ' ')) {
return;
}

const colIndex = event.currentTarget.closest('[aria-colindex]')?.getAttribute('aria-colindex');

if (colIndex !== SELECT_COLUMN_ARIA_INDEX) {
return;
}

event.preventDefault();
selection.selectRoot();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems like we can make a common function for all usages among the components. and reuse it


return (
<Checkbox disabled={disabled || selection.keys.length === 0} checked={checked} indeterminate={indeterminate} onChange={selection.selectRoot} />
<div className={CELL_CLASS_NAME} onClick={rootDisabled ? undefined : selection.selectRoot}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is not Command too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use checkbox with indeterminate state. Please do not break semantics of native checkbox element by changing it to the div. We need to find another way to fix initial issue

const checked = selection.selected.includes(id);

return (
<Command className={CELL_CLASS_NAME} disabled={disabled} tabIndex={0} onClick={() => selection.select(id)}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is it Command + Indicator implementation? not like a Checkbox itself?
Checkbox supposed to be tabable and clickable via keyboard

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, it should be checkbox, not command

const checked = selection.selected.includes(id);

return (
<Command className={CELL_CLASS_NAME} disabled={disabled} tabIndex={0} onClick={() => selection.select(id)}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, it should be checkbox, not command


return (
<Checkbox disabled={disabled || selection.keys.length === 0} checked={checked} indeterminate={indeterminate} onChange={selection.selectRoot} />
<div className={CELL_CLASS_NAME} onClick={rootDisabled ? undefined : selection.selectRoot}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use checkbox with indeterminate state. Please do not break semantics of native checkbox element by changing it to the div. We need to find another way to fix initial issue

…rove accessibility in tables

fix checkbox and header cell keyboard events
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.

3 participants