Skip to content

Commit

Permalink
fix: ensure the hidden filepicker gets disabled as well
Browse files Browse the repository at this point in the history
Related to #1239
  • Loading branch information
Skaiir committed Sep 5, 2024
1 parent df63741 commit 8b36418
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export function FilePicker(props) {
onChange({ value: _filesKey });
};

const _disabled = disabled || readonly || fileRegistry === null;

return (
<div className={formFieldClasses(type, { errors, disabled, readonly })}>
<Label htmlFor={domId} label={label} required={required} />
Expand All @@ -73,14 +75,15 @@ export function FilePicker(props) {
ref={fileInputRef}
id={domId}
name={domId}
disabled={_disabled}
multiple={evaluatedMultiple || undefined}
accept={evaluatedAccept || undefined}
onChange={onFileChange}
/>
<div className="fjs-filepicker-container">
<button
type="button"
disabled={disabled || readonly || fileRegistry === null}
disabled={_disabled}
readonly={readonly}
className="fjs-button"
onClick={() => {
Expand Down

0 comments on commit 8b36418

Please sign in to comment.