-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(content-uploader): Migrate UploadInput #3594
Conversation
f495a33
to
127c59f
Compare
// https://stackoverflow.com/questions/72787050/typescript-upload-directory-property-directory-does-not-exist-on-type | ||
// Extend the InputHTMLAttributes interface to include the directory attribute | ||
declare module 'react' { | ||
interface InputHTMLAttributes<T> extends React.HTMLAttributes<T> { | ||
directory?: string; | ||
webkitdirectory?: string; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this exist in some global or common types location? other upload inputs would encounter the same error too right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only input we are doing this in, I didnt see a reason to let the rest of them know they have two more props
/* eslint-disable */ // Disabling linting for tabIndex on label, unknown why it's there | ||
import * as React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we able to disable the specific error instead of the whole file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was the alt
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex,jsx-a11y/no-noninteractive-element-interactions <label className={inputLabelClass} onKeyDown={onKeyDown} tabIndex={0}>
thoughts on which one you think we should use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my thinking is we want to be putting role="button"
on the label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it narrowed it to a separate eslint error jsx-a11y/no-noninteractive-element-to-interactive-role
which is more manageable
but we also disable the other two errors in a few of the elements already:
box-ui-elements/src/elements/content-preview/ContentPreview.js
Lines 1317 to 1318 in 219300f
/* eslint-disable jsx-a11y/no-static-element-interactions */ | |
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */ |
} | ||
} | ||
|
||
export interface Props { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current pattern:
export interface Props { | |
export interface UploadInputProps { |
}; | ||
export default UploadInput; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit if you get to it:
}; | |
export default UploadInput; | |
}; | |
export default UploadInput; |
127c59f
to
43375b0
Compare
43375b0
to
4b613ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.js
to.js.flow