Skip to content

Commit

Permalink
fix(ui5-button): remove tabindex from disabled button (#8957)
Browse files Browse the repository at this point in the history
Fixes: #8852
  • Loading branch information
unazko committed May 23, 2024
1 parent 08b81c7 commit 041f573
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/main/src/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ class Button extends UI5Element implements IButton, IFormElement {
}

get tabIndexValue() {
if (this.disabled) {
return;
}

const tabindex = this.getAttribute("tabindex");

if (tabindex) {
Expand Down
3 changes: 2 additions & 1 deletion packages/main/test/specs/Button.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ describe("Button general interaction", () => {

const field = await browser.$("#click-counter");
assert.strictEqual(await field.getProperty("value"), "3", "Click should be called 3 times");
assert.ok(await nativeButton.hasAttribute("disabled"), )
assert.ok(await nativeButton.hasAttribute("disabled"), );
assert.notOk(await nativeButton.hasAttribute("tabindex"), "Disabled button doesn't have tabindex attribute");
});

it("tests clicking on disabled button whith Icon", async () => {
Expand Down

0 comments on commit 041f573

Please sign in to comment.