diff --git a/.eslintrc.json b/.eslintrc.json index 9f92a9627..8b289560f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,7 +18,8 @@ "i18n": true, "__": true, "__n": true, - "app": true + "app": true, + "IS_WEB": true }, "rules": { "no-multi-spaces": 0, diff --git a/src/ui/component/common/file-selector.jsx b/src/ui/component/common/file-selector.jsx index e542dd153..659e9597f 100644 --- a/src/ui/component/common/file-selector.jsx +++ b/src/ui/component/common/file-selector.jsx @@ -35,7 +35,6 @@ class FileSelector extends React.PureComponent { constructor() { super(); - this.input = null; // @if TARGET='web' this.fileInput = React.createRef(); // @endif @@ -67,19 +66,20 @@ class FileSelector extends React.PureComponent { ); } - handleFileInputSelection() { - const { files } = this.fileInput.current; - if (!files) { - return; - } + // TODO: Add this back for web publishing + // handleFileInputSelection() { + // const { files } = this.fileInput.current; + // if (!files) { + // return; + // } - const filePath = files[0]; - const fileName = filePath.name; + // const filePath = files[0]; + // const fileName = filePath.name; - if (this.props.onFileChosen) { - this.props.onFileChosen(filePath, fileName); - } - } + // if (this.props.onFileChosen) { + // this.props.onFileChosen(filePath, fileName); + // } + // } input: ?HTMLInputElement; @@ -91,27 +91,18 @@ class FileSelector extends React.PureComponent { return ( - {/* @if TARGET='app' */} { - if (this.input) this.input = input; - }} + webkitdirectory="true" + className="form-field--copyable" + type="text" + ref={this.fileInput} onFocus={() => { - if (this.input) this.input.select(); + if (this.fileInput) this.fileInput.current.select(); }} - readOnly='readonly' + readOnly="readonly" value={currentPath || __('No File Chosen')} - inputButton={ -