Skip to content

Commit

Permalink
fix: use TextEditorButton component so that tooltip is showing (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianniguida authored Jan 16, 2025
1 parent bc66315 commit 1942f54
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/src/forum/components/UploadButton.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import app from 'flarum/forum/app';
import Component from 'flarum/common/Component';
import Button from 'flarum/common/components/Button';
import TextEditorButton from 'flarum/common/components/TextEditorButton';
import LoadingIndicator from 'flarum/common/components/LoadingIndicator';
import classList from 'flarum/common/utils/classList';

Expand All @@ -25,7 +25,7 @@ export default class UploadButton extends Component {
: app.translator.trans('fof-upload.forum.buttons.upload');

return (
<Button
<TextEditorButton
className={classList([
'Button',
'hasIcon',
Expand All @@ -37,13 +37,14 @@ export default class UploadButton extends Component {
icon={!this.attrs.uploader.uploading && 'fas fa-file-upload'}
onclick={this.uploadButtonClicked.bind(this)}
disabled={this.attrs.disabled}
title={buttonText}
>
{this.attrs.uploader.uploading && <LoadingIndicator size="small" display="inline" className="Button-icon" />}
{(this.isMediaUploadButton || this.attrs.uploader.uploading) && <span className="Button-label">{buttonText}</span>}
<form>
<input type="file" multiple={true} onchange={this.process.bind(this)} />
</form>
</Button>
</TextEditorButton>
);
}

Expand Down

0 comments on commit 1942f54

Please sign in to comment.