Skip to content

Commit

Permalink
XWIKI-19145: Edit button must be unaccessible for keyboard while in e…
Browse files Browse the repository at this point in the history
…dit mode (#2191)

* Made the anchor semantically disabled when it used to do so visually (and get back to the regular state)
* Updated LESS to keep the button visually appealing
  • Loading branch information
Sereza7 committed Jun 1, 2023
1 parent 737ec0b commit 2eecf3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,10 @@ require(['jquery'], function($) {
}
// Disable the edit buttons and hide the section edit links.
editButton.add(translateButton).addClass('disabled');
editButton.attr('aria-disabled', 'true');
var reference = editButton.attr('href');
editButton.removeAttr('href');
editButton.attr('role', 'link');
$('#xwikicontent').children(':header').children('.edit_section').addClass('hidden');
event.preventDefault();
const handler = event.data;
Expand All @@ -1037,6 +1041,9 @@ require(['jquery'], function($) {
// * the translate button is restored (if needed) by the editInPlace module
// * the section edit links are restored when the document is rendered for view
editButton.removeClass('disabled');
editButton.removeAttr('aria-disabled');
editButton.removeAttr('role');
editButton.attr('href', reference);
});
// Fallback on the standalone edit mode if we fail to load the required modules.
}, disableInPlaceEditing.bind(event.target));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@
padding: @font-size-large;
}
}
a.btn.disabled {
opacity: 1;
.text-muted;
background-color: transparent;
}

.flat-buttons();
}

0 comments on commit 2eecf3f

Please sign in to comment.