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

Fix table cells and inputs being read ad 'clickable' in NVDA #5933

Merged
merged 4 commits into from
Jan 24, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class KolInputColor implements InputColorAPI {
_tooltipAlign={this._tooltipAlign}
_touched={this.state._touched}
onClick={() => this.ref?.focus()}
role={`presentation` /* Avoid element being read as 'clickable' in NVDA */}
>
<span slot="label">
{hasExpertSlot ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export class KolInputEmail implements InputEmailAPI {
_tooltipAlign={this._tooltipAlign}
_touched={this.state._touched}
onClick={() => this.ref?.focus()}
role={`presentation` /* Avoid element being read as 'clickable' in NVDA */}
>
<span slot="label">
{hasExpertSlot ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class KolInputFile implements InputFileAPI {
_tooltipAlign={this._tooltipAlign}
_touched={this.state._touched}
onClick={() => this.ref?.focus()}
role={`presentation` /* Avoid element being read as 'clickable' in NVDA */}
>
<span slot="label">
{hasExpertSlot ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export class KolInputPassword implements InputPasswordAPI {
_tooltipAlign={this._tooltipAlign}
_touched={this.state._touched}
onClick={() => this.ref?.focus()}
role={`presentation` /* Avoid element being read as 'clickable' in NVDA */}
>
<span slot="label">
{hasExpertSlot ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export class KolInputText implements InputTextAPI {
_tooltipAlign={this._tooltipAlign}
_touched={this.state._touched}
onClick={() => this.ref?.focus()}
role={`presentation` /* Avoid element being read as 'clickable' in NVDA */}
>
<span slot="label">
{hasExpertSlot ? (
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/components/select/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class KolSelect implements SelectAPI {
_tooltipAlign={this._tooltipAlign}
_touched={this.state._touched}
onClick={() => this.ref?.focus()}
role={`presentation` /* Avoid element being read as 'clickable' in NVDA */}
>
<span slot="label">
{hasExpertSlot ? (
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/components/textarea/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class KolTextarea implements TextareaAPI {
_tooltipAlign={this._tooltipAlign}
_touched={this.state._touched}
onClick={() => this.ref?.focus()}
role={`presentation` /* Avoid element being read as 'clickable' in NVDA */}
>
<span slot="label">
{hasExpertSlot ? (
Expand Down
7 changes: 5 additions & 2 deletions packages/samples/react/src/components/table/render-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ const HEADERS: KoliBriTableHeaders = {

/* Example 4: Render function using React */
render: (el) => {
el.setAttribute('role', 'presentation');
const renderElement = document.createElement('div');
renderElement.setAttribute('role', 'presentation');
el.innerHTML = '';
el.appendChild(renderElement);

/* https://react.dev/reference/react-dom/client/createRoot */
getRoot(el).render(
getRoot(renderElement).render(
<div
style={{
display: `grid`,
Expand Down
Loading