Fix tabindex

This commit is contained in:
IRBorisov 2023-09-04 19:12:27 +03:00
parent 7430041f7b
commit 04c3531f60
8 changed files with 14 additions and 4 deletions

View File

@ -38,6 +38,7 @@ function Checkbox({ id, required, disabled, tooltip, label, widthClass = 'w-full
disabled={disabled}
checked={value}
onChange={onChange}
tabIndex={-1}
/>
{ label &&
<Label

View File

@ -5,10 +5,11 @@ extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'title
noHover?: boolean
}
function MiniButton({ icon, tooltip, children, noHover, ...props }: MiniButtonProps) {
function MiniButton({ icon, tooltip, children, noHover, tabIndex, ...props }: MiniButtonProps) {
return (
<button type='button'
title={tooltip}
tabIndex={tabIndex ?? -1}
className={`px-1 py-1 font-bold rounded-full cursor-pointer whitespace-nowrap disabled:cursor-not-allowed clr-btn-clear ${noHover ? 'outline-none' : 'clr-hover'}`}
{...props}
>

View File

@ -21,6 +21,7 @@ function Navigation () {
title='Скрыть навигацию'
className='absolute top-0 right-0 z-[60] w-[1.2rem] h-[3rem] border-b-2 border-l-2 clr-btn-nav rounded-none'
onClick={toggleNoNavigation}
tabIndex={-1}
>
<p>{'>'}</p><p>{'>'}</p>
</button>}
@ -29,6 +30,7 @@ function Navigation () {
title='Показать навигацию'
className='absolute top-0 right-0 z-[60] px-1 h-[1.6rem] border-b-2 border-l-2 clr-btn-nav rounded-none'
onClick={toggleNoNavigation}
tabIndex={-1}
>
{''}
</button>}

View File

@ -12,6 +12,7 @@ function NavigationButton({ id, icon, description, onClick, text }: NavigationBu
title={description}
type='button'
onClick={onClick}
tabIndex={-1}
className={`flex items-center h-full gap-1 ${text ? 'px-2' : 'px-4'} mr-1 min-w-fit whitespace-nowrap clr-btn-nav`}
>
{icon && <span>{icon}</span>}

View File

@ -309,11 +309,12 @@ function EditorItems({ onOpenEdit, onCreateCst, onDeleteCst }: EditorItemsProps)
const type = typeStr as CstType;
return (
<Button key={type}
text={`${getCstTypePrefix(type)}`}
text={getCstTypePrefix(type)}
tooltip={getCstTypeShortcut(type)}
dense
widthClass='w-[1.4rem]'
disabled={!isEditable}
tabIndex={-1}
onClick={() => handleCreateCst(type)}
/>);
})}
@ -343,6 +344,7 @@ function EditorItems({ onOpenEdit, onCreateCst, onDeleteCst }: EditorItemsProps)
selectableRows
selectableRowsHighlight
selectableRowsComponentProps={{tabIndex: -1}}
onSelectedRowsChange={handleSelectionChange}
onRowDoubleClicked={cst => onOpenEdit(cst.id)}
onRowClicked={handleRowClicked}

View File

@ -132,9 +132,9 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified,
onChange={event => setComment(event.target.value)}
/>
<div className='flex justify-between whitespace-nowrap'>
<div></div>
<Checkbox id='common' label='Общедоступная схема'
value={common}
widthClass='w-fit mt-3'
disabled={!isEditable}
onChange={event => setCommon(event.target.checked)}
/>

View File

@ -76,6 +76,7 @@ function RSTabsMenu({
widthClass='h-full w-fit'
dense
onClick={schemaMenu.toggle}
tabIndex={-1}
/>
{ schemaMenu.isActive &&
<Dropdown>
@ -125,6 +126,7 @@ function RSTabsMenu({
icon={<PenIcon size={5} color={isEditable ? 'text-success' : 'text-warning'}/>}
dense
onClick={editMenu.toggle}
tabIndex={-1}
/>
{ editMenu.isActive &&
<Dropdown>
@ -168,6 +170,7 @@ function RSTabsMenu({
borderClass=''
dense
onClick={onToggleSubscribe}
tabIndex={-1}
/>
</div>
</div>