Skip to content

Commit

Permalink
FileUploader: input should get the 'title' attribute with a correct v…
Browse files Browse the repository at this point in the history
…alue for hint working in FireFox (T1187412) (#25668)

Co-authored-by: Alexander Bulychev <[email protected]>
  • Loading branch information
iBat and Alexander Bulychev authored Sep 26, 2023
1 parent 5d12afd commit 3db06ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/ui/file_uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ class FileUploader extends Editor {
this._$fileInput.prop({
multiple: this.option('multiple'),
accept: this.option('accept'),
title: this.option('hint') || null,
tabIndex: -1
});
}
Expand Down Expand Up @@ -1428,6 +1429,10 @@ class FileUploader extends Editor {
case 'inputAttr':
this._applyInputAttributes(this.option(name));
break;
case 'hint':
this._initFileInput();
super._optionChanged(args);
break;
default:
super._optionChanged(args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,20 @@ QUnit.module('the \'name\' option', () => {
});
});

QUnit.module('the "hint" option', () => {
QUnit.test('widget input should get the "title" attribute with a correct value for hint working in FireFox (T1187412)', function(assert) {
const hint = 'CUSTOM HINT';
const $element = $('#fileuploader').dxFileUploader({
hint
});
const instance = $element.dxFileUploader('instance');
const $input = $element.find(`.${FILEUPLOADER_INPUT_CLASS}`);

assert.strictEqual($input.attr('title'), hint, 'the input "title" attribute has correct value');

const newHint = 'NEW HINT VALUE';
instance.option('hint', newHint);

assert.strictEqual($input.attr('title'), newHint, 'the input "title" attribute has changed');
});
});

0 comments on commit 3db06ad

Please sign in to comment.