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: accessibility-related warnings #1012

Merged
merged 1 commit into from
Mar 20, 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
2 changes: 1 addition & 1 deletion src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Navbar = ({ toggleSidebar }) => {
return (
<header className='navbar'>
{toggleSidebar && (
<button className='sidebar-button' onClick={toggleSidebar}>
<button className='sidebar-button' onClick={toggleSidebar} aria-label='toggle sidebar'>
<svg
xmlns='http://www.w3.org/2000/svg'
aria-hidden='true'
Expand Down
1 change: 1 addition & 0 deletions src/components/SidePanel/SidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const Dialog = ({ open, onClose, className, children }) => {
className='sidepanel-backdrop'
ref={containerRef}
role='button'
aria-label='close sidepanel'
tabIndex={0}
onMouseDown={(event) => {
if (event.target === event.currentTarget) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const DropdownSelect = ({ id = 'unknown', value, onChange, children }) => {
return (
<div
className='dropdown-select'
role='none'
onBlur={(e) => !e.relatedTarget?.classList?.contains(`keep-focus-${id}`) && close()}
>
<button onClick={toggleOpen} className={`keep-focus-${id}`}>
Expand All @@ -48,7 +49,7 @@ const DropdownSelect = ({ id = 'unknown', value, onChange, children }) => {
<div className={`options-container${open ? ' options-container--open' : ''}`}>
<div
className='options-container-backdrop'
role='button'
role='none'
onMouseDown={(event) => {
if (event.target === event.currentTarget) {
toggleOpen();
Expand Down
9 changes: 7 additions & 2 deletions src/components/ThemeSettings/ThemeSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ const ThemeSettings = () => {

return (
<>
<button className='icon-btn' onClick={togglePanel} style={{ alignSelf: 'center' }}>
<button
className='icon-btn'
onClick={togglePanel}
style={{ alignSelf: 'center' }}
aria-label='theme settings'
>
<Theme />
</button>
<SidePanel open={panelOpen} onClose={closePanel} className='theme-settings'>
<div className='theme-settings-header'>
<p>Reading Options</p>
<button className='icon-btn' onClick={closePanel}>
<button className='icon-btn' onClick={closePanel} aria-label='close'>
<Close />
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/theme-hooks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import '../styles/themes/black.css';
import '../styles/themes/gruvbox.css';
import '../styles/themes/nord.css';
Expand Down
Loading