mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
feat(accessibility): add tabbing to chart menu in dashboard (#26138)
Co-authored-by: geido <diegopucci.me@gmail.com> Co-authored-by: Diego Pucci <geido@Diegos-MBP.wind3.hub>
This commit is contained in:
committed by
GitHub
parent
662c1ed618
commit
34b1db219c
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React, { useMemo, useState, useEffect } from 'react';
|
||||
import React, { useMemo, useState, useEffect, useRef, RefObject } from 'react';
|
||||
import {
|
||||
css,
|
||||
GenericDataType,
|
||||
@@ -96,9 +96,20 @@ export const CopyToClipboardButton = ({
|
||||
|
||||
export const FilterInput = ({
|
||||
onChangeHandler,
|
||||
shouldFocus = false,
|
||||
}: {
|
||||
onChangeHandler(filterText: string): void;
|
||||
shouldFocus?: boolean;
|
||||
}) => {
|
||||
const inputRef: RefObject<any> = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
// Focus the input element when the component mounts
|
||||
if (inputRef.current && shouldFocus) {
|
||||
inputRef.current.focus();
|
||||
}
|
||||
}, []);
|
||||
|
||||
const theme = useTheme();
|
||||
const debouncedChangeHandler = debounce(onChangeHandler, SLOW_DEBOUNCE);
|
||||
return (
|
||||
@@ -113,6 +124,7 @@ export const FilterInput = ({
|
||||
width: 200px;
|
||||
margin-right: ${theme.gridUnit * 2}px;
|
||||
`}
|
||||
ref={inputRef}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user