mirror of https://github.com/buster-so/buster.git
Update aria accesiblity controls
This commit is contained in:
parent
c2dee1e5be
commit
9f44595712
|
@ -3,7 +3,6 @@
|
||||||
import React, {
|
import React, {
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useLayoutEffect,
|
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
useImperativeHandle,
|
useImperativeHandle,
|
||||||
|
@ -793,3 +792,4 @@ const AppSplitterBase = forwardRef<
|
||||||
export const AppSplitter = React.memo(AppSplitterWrapper);
|
export const AppSplitter = React.memo(AppSplitterWrapper);
|
||||||
|
|
||||||
AppSplitter.displayName = 'AppSplitter';
|
AppSplitter.displayName = 'AppSplitter';
|
||||||
|
AppSplitterBase.displayName = 'AppSplitterBase';
|
||||||
|
|
|
@ -152,6 +152,7 @@ function SelectComponent<T = string>({
|
||||||
const [isFocused, setIsFocused] = React.useState(false);
|
const [isFocused, setIsFocused] = React.useState(false);
|
||||||
const inputRef = React.useRef<HTMLInputElement>(null);
|
const inputRef = React.useRef<HTMLInputElement>(null);
|
||||||
const commandRef = React.useRef<HTMLDivElement>(null);
|
const commandRef = React.useRef<HTMLDivElement>(null);
|
||||||
|
const listboxId = React.useId();
|
||||||
|
|
||||||
const open = controlledOpen !== undefined ? controlledOpen : internalOpen;
|
const open = controlledOpen !== undefined ? controlledOpen : internalOpen;
|
||||||
|
|
||||||
|
@ -342,6 +343,7 @@ function SelectComponent<T = string>({
|
||||||
type="text"
|
type="text"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
aria-expanded={open}
|
aria-expanded={open}
|
||||||
|
aria-controls={listboxId}
|
||||||
aria-label={placeholder}
|
aria-label={placeholder}
|
||||||
disabled={disabled || loading}
|
disabled={disabled || loading}
|
||||||
value={inputDisplayValue}
|
value={inputDisplayValue}
|
||||||
|
@ -398,7 +400,7 @@ function SelectComponent<T = string>({
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
<div className="scrollbar-hide max-h-[300px] overflow-y-auto">
|
<div className="scrollbar-hide max-h-[300px] overflow-y-auto">
|
||||||
<CommandList className="p-1">
|
<CommandList id={listboxId} className="p-1">
|
||||||
<CommandEmpty>{emptyMessage}</CommandEmpty>
|
<CommandEmpty>{emptyMessage}</CommandEmpty>
|
||||||
{renderedItems}
|
{renderedItems}
|
||||||
</CommandList>
|
</CommandList>
|
||||||
|
|
|
@ -41,11 +41,9 @@ export const ChatLayout: React.FC<ChatSplitterProps> = ({ children }) => {
|
||||||
const mounted = true;
|
const mounted = true;
|
||||||
|
|
||||||
const bustStorageOnInit = (preservedSideValue: number | null, containerSize: number) => {
|
const bustStorageOnInit = (preservedSideValue: number | null, containerSize: number) => {
|
||||||
console.log('bustStorageOnInit', autoSaveId, preservedSideValue, {
|
if (containerSize && !preservedSideValue) {
|
||||||
selectedLayout,
|
return true;
|
||||||
secondaryFileView,
|
}
|
||||||
containerSize
|
|
||||||
});
|
|
||||||
return selectedLayout === 'chat-only' || selectedLayout === 'file-only' || !!secondaryFileView;
|
return selectedLayout === 'chat-only' || selectedLayout === 'file-only' || !!secondaryFileView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue