Skip to content

Commit

Permalink
Initial fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkithelegendarypokemonster committed Sep 3, 2024
1 parent bc17ce6 commit 395d0a7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ const HtmlEditor = Editor.inherit({
this._prepareConverters();

this.callBase();
this._toggleReadOnlyState();
},

_prepareQuillRegistrator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,32 @@ export default function() {
});

QUnit.module('Accessibility', () => {
test('aria-readonly should be set on initialization', function(assert) {
const $element = $('#htmlEditor');

$element.dxHtmlEditor({
readOnly: true
});

const $editorContent = $element.find(`.${HTML_EDITOR_CONTENT_CLASS}`);
assert.strictEqual($editorContent.attr('aria-readonly'), 'true', 'aria-readonly is set on initialization');
});

test('aria-readonly should be set during option change in runtime', function(assert) {
const $element = $('#htmlEditor');

$element.dxHtmlEditor({
readOnly: false
});
const instance = $element.dxHtmlEditor('instance');

const $editorContent = $element.find(`.${HTML_EDITOR_CONTENT_CLASS}`);
assert.strictEqual($editorContent.attr('aria-readonly'), undefined, 'aria-readonly is properly set on initialization');

instance.option('readOnly', true);
assert.strictEqual($editorContent.attr('aria-readonly'), 'true', 'aria-readonly is properly set on runtime');
});

test('accessibility roles', function(assert) {
const $element = $('#htmlEditor');

Expand Down

0 comments on commit 395d0a7

Please sign in to comment.