jquense / react-widgets

Polished, feature rich, accessible form inputs built with React
http://jquense.github.io/react-widgets/
MIT License
2.34k stars 395 forks source link

Unable to set tabindex on footer of calendar widget #1145

Open garethquirke opened 1 year ago

garethquirke commented 1 year ago

image

The tabindex is hardcoded and I have no options to control it for the footer button of the calendar.

The only options for the footer are: footer: boolean (display it) footerFormat: string

Have tried to set the tab index by using a hook and accessing the DOM element to set attribute but that fails to work.

` React.useEffect(() => { const footerElement = document.querySelector('.rw-calendar-footer .rw-btn');

    if (footerElement) {

        footerElement.setAttribute("tabindex", "0");
        footerElement.tabIndex = 0;
        footerElement.tabindex = 0;
    }
}, [openState]);`