Skip to content

Commit

Permalink
feat(dom): Add labels to buttons (#1234)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Dishant Kapoor <dishant.kapoor@swspvtltd.com>
  • Loading branch information
dishantkapoor and Dishant Kapoor authored Feb 6, 2024
1 parent f03403d commit 12d1596
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/autocomplete-js/src/createAutocompleteDom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ export function createAutocompleteDom<TItem extends BaseItem>({
const detachedSearchButton = createDomElement('button', {
type: 'button',
class: classNames.detachedSearchButton,
title: translations.detachedSearchButtonTitle,
id: labelProps.id,
onClick() {
setIsModalOpen(true);
},
Expand Down
1 change: 1 addition & 0 deletions packages/autocomplete-js/src/getDefaultOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export function getDefaultOptions<TItem extends BaseItem>(
const defaultTranslations: AutocompleteTranslations = {
clearButtonTitle: 'Clear',
detachedCancelButtonText: 'Cancel',
detachedSearchButtonTitle: 'Search',
submitButtonTitle: 'Submit',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export type AutocompleteTranslations = {
detachedCancelButtonText: string;
clearButtonTitle: string;
submitButtonTitle: string;
detachedSearchButtonTitle: string;
};

0 comments on commit 12d1596

Please sign in to comment.