Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

A11y: add aria attribute to give the upload field a name

Jason Miller11bebfc836cd
diff --git a/src/components/header/index.tsx b/src/components/header/index.tsx
index 1499d061..f513a16c 100644
--- a/src/components/header/index.tsx
+++ b/src/components/header/index.tsx
@@ -40,13 +40,13 @@ export default class Header extends Component<Props, State> {
<Toolbar fixed class={cx(c, style.toolbar, 'inert', !showHeader && style.minimal)}>
<Toolbar.Row>
<Toolbar.Title class={style.title}>
- <Toolbar.Icon title="Upload" ripple onClick={this.upload}>file_upload</Toolbar.Icon>
+ <Toolbar.Icon title="Upload" ripple onClick={this.upload} id="uploadIcon">file_upload</Toolbar.Icon>
</Toolbar.Title>
<Toolbar.Section align-end>
<Toolbar.Icon ripple onClick={onToggleDrawer}>menu</Toolbar.Icon>
</Toolbar.Section>
</Toolbar.Row>
- <input class={style.fileInput} ref={this.setInputRef} type="file" onChange={this.handleFiles} />
+ <input class={style.fileInput} ref={this.setInputRef} type="file" onChange={this.handleFiles} aria-labelledby="uploadIcon" />
</Toolbar>
);
}