-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Current Behaviour
The FileInput component supports the buttonLabel prop and the InputFile.Button component supports the label prop but assigning an empty string (label="") results in the component rendering the default label of Upload File.
Expected Behaviour
I would like to be able to assign and empty string to the label prop and have the button component rendered without a label so I can use the component as an icon only button.
Proposal
The fix appears to be a trivial change here https://github.com/GetJobber/atlantis/blob/master/packages/components/src/InputFile/InputFileButton.tsx#L25
label={label || contextLabel}
to:
label={label ?? contextLabel}
If label is defined then it is used even if empty instead of only used if not empty. This shouldn't have unintended impacts as the prop is not required so likely is not passed as empty string when the default is actually wanted.