Skip to content

Commit 623ee3a

Browse files
Merge remote-tracking branch 'origin/main' into radio_button_fontsize
2 parents ca5c957 + 0352ff0 commit 623ee3a

15 files changed

Lines changed: 80 additions & 12 deletions

packages/ai/src/InputTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function InputTemplate(this: Input, hooks?: { preContent: Templat
4242
style={this.styles.innerInput}
4343
type={this.inputNativeType}
4444
inner-input
45-
inner-input-with-icon={!!this.icon.length}
45+
inner-input-with-icon={this.iconsCount > 0}
4646
disabled={this.disabled}
4747
readonly={this._readonly || this.loading}
4848
value={this.value}

packages/main/cypress/specs/Avatar.cy.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ describe("Accessibility", () => {
123123
});
124124

125125
// New tests for mode property
126+
it("mode='Decorative' returns empty accessibilityInfo", () => {
127+
cy.mount(
128+
<Avatar mode="Decorative" initials="JD" id="decorative-avatar"></Avatar>
129+
);
130+
cy.get("#decorative-avatar").then(($el) => {
131+
const avatar = $el[0] as any;
132+
expect(avatar.accessibilityInfo).to.deep.equal({});
133+
});
134+
});
135+
126136
it("mode='Decorative' renders with role='presentation' and aria-hidden", () => {
127137
cy.mount(
128138
<Avatar

packages/main/cypress/specs/MultiComboBox.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4027,7 +4027,7 @@ describe("Keyboard Handling", () => {
40274027

40284028
it("Should select/deselect a token with CTRL+SPACE", () => {
40294029
cy.mount(
4030-
<MultiComboBox noValidation={true}>
4030+
<MultiComboBox style={{ width: "300px" }} noValidation={true}>
40314031
<MultiComboBoxItem selected={true} text="Item 1"></MultiComboBoxItem>
40324032
<MultiComboBoxItem selected={true} text="Item 2"></MultiComboBoxItem>
40334033
</MultiComboBox>

packages/main/src/Avatar.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
540540
}
541541

542542
get accessibilityInfo() {
543+
if (this.mode === AvatarMode.Decorative) {
544+
return {};
545+
}
546+
543547
return {
544548
role: this._role as AriaRole,
545549
type: this._interactive ? Avatar.i18nBundle.getText(AVATAR_TYPE_BUTTON) : Avatar.i18nBundle.getText(AVATAR_TYPE_IMAGE),

packages/main/src/InputTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function InputTemplate(this: Input, hooks?: { preContent: Templat
3030
style={this.styles.innerInput}
3131
type={this.inputNativeType}
3232
inner-input
33-
inner-input-with-icon={!!this.icon.length}
33+
inner-input-with-icon={this.iconsCount > 0}
3434
disabled={this.disabled}
3535
readonly={this._readonly}
3636
value={this.value}

packages/main/src/MultiComboBoxTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default function MultiComboBoxTemplate(this: MultiComboBox) {
6565
id="ui5-multi-combobox-input"
6666
value={this.value}
6767
inner-input
68+
inner-input-with-icon={this._effectiveShowClearIcon || !!this.icon || !this.readonly}
6869
placeholder={this._getPlaceholder}
6970
disabled={this.disabled}
7071
readonly={this.readonly}

packages/main/src/MultiInput.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ class MultiInput extends Input implements IFormInputElement {
359359

360360
if (this.tokenizer) {
361361
this.tokenizer.readonly = this.readonly;
362+
363+
// Set the CSS variable on the tokenizer element so it's available in the shadow DOM
364+
this.tokenizer.style.setProperty("--_ui5-input-icons-count", `${this.iconsCount}`);
362365
}
363366
}
364367

packages/main/src/Token.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ class Token extends UI5Element implements IToken {
127127
@property({ type: Boolean })
128128
toBeDeleted = false;
129129

130+
/**
131+
* Set by the tokenizer to mark the last visible token before overflow.
132+
* @default false
133+
* @private
134+
*/
135+
@property({ type: Boolean })
136+
lastVisibleToken = false;
137+
130138
/**
131139
* Defines the tabIndex of the component.
132140
* @private

packages/main/src/Tokenizer.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ class Tokenizer extends UI5Element implements IFormInputElement {
422422
this._tokens.forEach(token => {
423423
token.singleToken = (tokensLength === 1) || this.multiLine;
424424
token.readonly = this.readonly;
425+
// Clear lastVisibleToken when expanding
426+
if (this.expanded && token.lastVisibleToken) {
427+
token.lastVisibleToken = false;
428+
}
425429
});
426430
}
427431

@@ -513,6 +517,27 @@ class Tokenizer extends UI5Element implements IFormInputElement {
513517

514518
this._scrollToEndIfNeeded();
515519
this._tokenDeleting = false;
520+
521+
// Update lastVisibleToken after rendering is complete to avoid render loops
522+
renderFinished().then(() => {
523+
this._updateLastVisibleTokenAttribute();
524+
});
525+
}
526+
527+
/**
528+
* Updates the lastVisibleToken property on tokens.
529+
* When collapsed with overflow, marks the last visible token for proper spacing to the n-more indicator.
530+
* @private
531+
*/
532+
_updateLastVisibleTokenAttribute() {
533+
const tokensArray = this._tokens;
534+
const hasOverflow = this._nMoreCount > 0;
535+
const visibleTokens = tokensArray.filter(token => !token.overflows);
536+
const lastVisibleToken = visibleTokens.length > 0 ? visibleTokens[visibleTokens.length - 1] : undefined;
537+
538+
tokensArray.forEach(token => {
539+
token.lastVisibleToken = (!this.expanded && hasOverflow && token === lastVisibleToken);
540+
});
516541
}
517542

518543
/**

packages/main/src/themes/ComboBox.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@
88
width: 100%;
99
height: 100%;
1010
border-radius: var(--_ui5_input_border_radius);
11+
}
12+
13+
:host(:not([readonly])) [inner-input] {
14+
padding: var(--_ui5_input_inner_padding_with_icon);
1115
}

0 commit comments

Comments
 (0)