Skip to content

Commit 116c5e5

Browse files
authored
Merge pull request #333 from UiPath/fix/a11y_suggest
fix(suggest): condition title display by input
2 parents fbc3249 + 7ffd96f commit 116c5e5

File tree

7 files changed

+34
-7
lines changed

7 files changed

+34
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v14.7.6 (2023-05-09)
2+
* **suggest** condition title display by input
3+
14
# v14.7.5 (2023-05-05)
25
* **grid** fix styling of resize icon
36
* **suggest** change focus logic

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-components",
3-
"version": "14.7.5",
3+
"version": "14.7.6",
44
"author": {
55
"name": "UiPath Inc",
66
"url": "https://uipath.com"

projects/angular/components/ui-suggest/src/ui-suggest.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<ng-template #showDefaultValue>
5151
<div [matTooltip]="tooltip ?? ''"
5252
class="display-container text-ellipsis">
53-
<span *ngIf="!isFormControl && placeholder"
53+
<span *ngIf="!isFormControl && placeholder && !shouldHideTitle"
5454
class="display-title"
5555
aria-hidden="true">
5656
{{ placeholder }}:

projects/angular/components/ui-suggest/src/ui-suggest.component.spec.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class UiSuggestFixtureDirective {
9393
fetchStrategy: 'eager' | 'onOpen' = 'eager';
9494
searchSourceStrategy: 'default' | 'lazy' = 'default';
9595
minChars = 0;
96+
shouldHideTitle = false;
9697

9798
displayValueFactory?: (value: ISuggestValue[]) => string;
9899

@@ -159,6 +160,21 @@ const sharedSpecifications = (
159160
});
160161

161162
describe('Behavior: standard usage', () => {
163+
([true, false].forEach(shouldHideTitle => {
164+
it(`should ${shouldHideTitle ? 'not' : ''} display title if shouldHideTitle is ${shouldHideTitle}`, () => {
165+
component.placeholder = 'some place holder';
166+
component.shouldHideTitle = shouldHideTitle;
167+
168+
fixture.detectChanges();
169+
const spanElem = document.querySelector('.display-title');
170+
if (shouldHideTitle || uiSuggest.isFormControl) {
171+
expect(spanElem).toBeNull();
172+
} else {
173+
expect(spanElem).toBeTruthy();
174+
}
175+
});
176+
}));
177+
162178
it('should be initialized', () => {
163179
expect(uiSuggest).toBeDefined();
164180
});
@@ -2699,7 +2715,8 @@ describe('Component: UiSuggest', () => {
26992715
[minChars]="minChars"
27002716
[drillDown]="drillDown"
27012717
[readonly]="readonly"
2702-
[compact]="compact">
2718+
[compact]="compact"
2719+
[shouldHideTitle]="shouldHideTitle">
27032720
</ui-suggest>
27042721
`,
27052722
})

projects/angular/components/ui-suggest/src/ui-suggest.mat-form-field.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
} from '@angular/core';
1717
import {
1818
ControlValueAccessor,
19-
UntypedFormControl,
2019
FormGroupDirective,
2120
NgControl,
2221
NgForm,
22+
UntypedFormControl,
2323
} from '@angular/forms';
2424
import { ErrorStateMatcher } from '@angular/material/core';
2525
import { MatFormFieldControl } from '@angular/material/form-field';
@@ -103,6 +103,13 @@ export abstract class UiSuggestMatFormFieldDirective implements
103103
this.stateChanges.next();
104104
}
105105

106+
/**
107+
* Hides the combo box title.
108+
*
109+
*/
110+
@Input()
111+
shouldHideTitle = false;
112+
106113
/**
107114
* Set a custom size for the list items.
108115
*

projects/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uipath/angular",
3-
"version": "14.7.5",
3+
"version": "14.7.6",
44
"license": "MIT",
55
"author": {
66
"name": "UiPath Inc",

0 commit comments

Comments
 (0)