commit 67e130a7709e1b43fe006bb17ebefdb9fcbbf6be parent ce4b919c6651f0483e32f8f4ca4e6d6397ea63d2 Author: MTRNord <mtrnord1@gmail.com> Date: Tue, 25 Jan 2022 01:42:10 +0100 Fix linter/some a11y issues Diffstat:
| M | components/submit_page/main.tsx | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/components/submit_page/main.tsx b/components/submit_page/main.tsx @@ -46,11 +46,16 @@ class MainSubmissionForm extends PureComponent<Props, State> { renderThumbs() { return this.props.files.map((file, index) => { const setIndex = () => { this.setState({ currentFileIndex: index }); }; + // TODO FIXME do make this work with keyboard presses! + + /* eslint-disable jsx-a11y/click-events-have-key-events */ return ( - <div className="relative cursor-pointer w-auto aspect-video" onClick={setIndex} style={{ height: "140px" }} key={file.name}> + <div className="relative cursor-pointer w-auto aspect-video" onClick={setIndex} style={{ height: "140px" }} key={file.name} role="radio" tabIndex={index} aria-checked={this.state.currentFileIndex == index ? true : false}> <img alt={file.name} className="h-auto w-full object-cover max-w-full align-bottom aspect-video" style={{ height: "140px" }} src={file.preview_url} /> </div> ); + + /* eslint-enable jsx-a11y/click-events-have-key-events */ }); }