Skip to content

Commit

Permalink
ProgressBar: Remove aria-readonly attribute (#27984)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkithelegendarypokemonster authored Sep 3, 2024
1 parent 531f561 commit bc17ce6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/devextreme/js/__internal/ui/m_progress_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ const ProgressBar = TrackBar.inherit({
]);
},

_toggleReadOnlyState() {
this.setAria('readonly', undefined);
},

_initMarkup() {
this._renderStatus();
this._createCompleteAction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,43 @@ QUnit.module('states', {
});

QUnit.module('aria accessibility', () => {
QUnit.test('aria-readonly is removed in initialization', function(assert) {
const $element = $('#progressbar').dxProgressBar({
readOnly: true,
});

assert.strictEqual($element.attr('aria-readonly'), undefined, 'aria-readonly is removed');
});

QUnit.test('aria-readonly should not exist after value change', function(assert) {
const $element = $('#progressbar').dxProgressBar({
readOnly: true,
value: 58
});

const instance = $element.dxProgressBar('instance');

instance.option({
value: 59
});

assert.strictEqual($element.attr('aria-readonly'), undefined, 'aria-readonly is removed');
});

QUnit.test('aria-readonly should not exist after readOnly option change', function(assert) {
const $element = $('#progressbar').dxProgressBar({
readOnly: false,
});

const instance = $element.dxProgressBar('instance');

instance.option({
readOnly: true,
});

assert.strictEqual($element.attr('aria-readonly'), undefined, 'aria-readonly is removed');
});

QUnit.test('aria properties after options changed', function(assert) {
const $element = $('#progressbar').dxProgressBar({
min: 32,
Expand Down

0 comments on commit bc17ce6

Please sign in to comment.