Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/main/cypress/specs/ComboBox.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ describe("General Interaction", () => {
cy.get("[ui5-combobox]").should("have.prop", "focused", true);
});

it("keeps focused state when clicking on the arrow icon", () => {
cy.mount(
<ComboBox>
<ComboBoxItem text="One" />
</ComboBox>
);

cy.get("[ui5-combobox]").shadow().find("[ui5-icon]").realMouseDown();
cy.get("[ui5-combobox]").should("have.prop", "focused", true);
});

it("tests Combo with two-column layout", () => {
cy.mount(
<ComboBox>
Expand Down
24 changes: 24 additions & 0 deletions packages/main/cypress/specs/MultiInput.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,30 @@ describe("MultiInput Web Component", () => {
cy.get("@valueHelpTrigger")
.should("have.been.calledTwice");
});

it("keeps focused state when clicking on value help icon", () => {
cy.mount(
<MultiInput showValueHelpIcon={true}>
<Token slot="tokens" text="Amet"></Token>
</MultiInput>
);

cy.get("[ui5-multi-input]")
.as("multiInput");

cy.get("@multiInput")
.shadow()
.find(".ui5-input-inner")
.as("innerInput");

cy.get("@multiInput")
.shadow()
.find("[ui5-icon]")
.realMouseDown();

cy.get("@multiInput")
.should("have.prop", "focused", true);
});
})

describe("MultiInput tokens", () => {
Expand Down
6 changes: 5 additions & 1 deletion packages/main/src/ComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,12 @@ class ComboBox extends UI5Element implements IFormInputElement {
});
}

_arrowClick() {
_arrowMouseDown(e: MouseEvent) {
e.preventDefault();
this.inner.focus();
}

_arrowClick() {
this._resetFilter();

if (isPhone() && this.value && !this._lastValue) {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/ComboBoxTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function ComboBoxTemplate(this: ComboBox) {
"inputIcon--pressed": this._iconPressed,
}}
accessibleName={this._iconAccessibleNameText}
onMouseDown={this._arrowMouseDown}
onClick={this._arrowClick}
/>
}
Expand Down
5 changes: 2 additions & 3 deletions packages/main/src/MultiInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import type Token from "./Token.js";
import type Tokenizer from "./Tokenizer.js";
import { getTokensCountText } from "./Tokenizer.js";
import type { TokenizerTokenDeleteEventDetail } from "./Tokenizer.js";
import type Icon from "./Icon.js";

import type {
InputSelectionChangeEventDetail as MultiInputSelectionChangeEventDetail,
Expand Down Expand Up @@ -215,11 +214,11 @@ class MultiInput extends Input implements IFormInputElement {
}

valueHelpMouseDown(e: MouseEvent) {
const target = e.target as Icon;
e.preventDefault();
this.focus();
this.closeValueStatePopover();
this.tokenizer.open = false;
this._valueHelpIconPressed = true;
target.focus();
}

_tokenizerFocusOut(e: FocusEvent) {
Expand Down
Loading