Skip to content

Commit 12d1596

Browse files
dishantkapoorDishant Kapoor
andauthored
feat(dom): Add labels to buttons (#1234)
--------- Co-authored-by: Dishant Kapoor <[email protected]>
1 parent f03403d commit 12d1596

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

packages/autocomplete-js/src/createAutocompleteDom.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ export function createAutocompleteDom<TItem extends BaseItem>({
161161
const detachedSearchButton = createDomElement('button', {
162162
type: 'button',
163163
class: classNames.detachedSearchButton,
164+
title: translations.detachedSearchButtonTitle,
165+
id: labelProps.id,
164166
onClick() {
165167
setIsModalOpen(true);
166168
},

packages/autocomplete-js/src/getDefaultOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export function getDefaultOptions<TItem extends BaseItem>(
138138
const defaultTranslations: AutocompleteTranslations = {
139139
clearButtonTitle: 'Clear',
140140
detachedCancelButtonText: 'Cancel',
141+
detachedSearchButtonTitle: 'Search',
141142
submitButtonTitle: 'Submit',
142143
};
143144

packages/autocomplete-shared/src/js/AutocompleteTranslations.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export type AutocompleteTranslations = {
22
detachedCancelButtonText: string;
33
clearButtonTitle: string;
44
submitButtonTitle: string;
5+
detachedSearchButtonTitle: string;
56
};

0 commit comments

Comments
 (0)