Skip to content

Commit c52c5d5

Browse files
authored
fix(tags): use proper type on default template remove button (#1293)
1 parent 67d0fce commit c52c5d5

File tree

12 files changed

+23
-0
lines changed

12 files changed

+23
-0
lines changed

examples/github-notification-filters/components/TagItem.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function TagItem({ label, remove }: Tag) {
88
<div className="aa-Tag">
99
<span className="aa-TagLabel">{label}</span>
1010
<button
11+
type="button"
1112
className="aa-TagRemoveButton"
1213
onClick={() => remove()}
1314
title="Remove this tag"

examples/query-suggestions-with-inline-categories/app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const querySuggestionsPlugin = createQuerySuggestionsPlugin({
6262

6363
<div className="aa-ItemActions">
6464
<button
65+
type="button"
6566
className="aa-ItemActionButton"
6667
title={`Fill query with "${item.query}"`}
6768
onClick={(event) => {

examples/recently-viewed-items/recentlyViewedItemsPlugin.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export function createLocalStorageRecentlyViewedItems<
100100
</div>
101101
<div className="aa-ItemActions">
102102
<button
103+
type="button"
103104
className="aa-ItemActionButton"
104105
title="Remove this search"
105106
onClick={(event) => {

examples/tags-in-searchbox/app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function TagItem<TTag>({ label, remove }: TagItemProps<TTag>) {
7373
<div className="aa-Tag">
7474
<span className="aa-TagLabel">{label}</span>
7575
<button
76+
type="button"
7677
className="aa-TagRemoveButton"
7778
onClick={() => remove()}
7879
title="Remove this tag"

examples/two-column-layout/src/plugins/productsPlugin.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ function ProductItem({ hit, components }: ProductItemProps) {
172172
</div>
173173

174174
<button
175+
type="button"
175176
className="aa-ItemFavorite"
176177
onClick={(event) => {
177178
event.preventDefault();

examples/voice-search/voiceSearchPlugin.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export function createVoiceSearchPlugin({
9999
function VoiceSearchButton({ onClick }) {
100100
return (
101101
<button
102+
type="button"
102103
className="aa-VoiceSearchButton"
103104
title="Voice Search"
104105
onClick={(event) => {
@@ -143,6 +144,7 @@ function VoiceSearchOverlay({ status, transcript, onCancel }) {
143144
<div className="aa-VoiceSearchWrapper">
144145
<div>{transcript || getStatusText(status)}</div>
145146
<button
147+
type="button"
146148
className="aa-VoiceSearchListeningButton"
147149
onClick={(event) => {
148150
event.preventDefault();

packages/autocomplete-plugin-query-suggestions/src/__tests__/createQuerySuggestionsPlugin.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ describe('createQuerySuggestionsPlugin', () => {
160160
<button
161161
class="aa-ItemActionButton"
162162
title="Fill query with \\"cooktop\\""
163+
type="button"
163164
>
164165
<svg
165166
fill="currentColor"
@@ -208,6 +209,7 @@ describe('createQuerySuggestionsPlugin', () => {
208209
<button
209210
class="aa-ItemActionButton"
210211
title="Fill query with \\"range\\""
212+
type="button"
211213
>
212214
<svg
213215
fill="currentColor"
@@ -327,6 +329,7 @@ describe('createQuerySuggestionsPlugin', () => {
327329
<button
328330
class="aa-ItemActionButton"
329331
title="Fill query with \\"range\\""
332+
type="button"
330333
>
331334
<svg
332335
fill="currentColor"
@@ -716,6 +719,7 @@ describe('createQuerySuggestionsPlugin', () => {
716719
<button
717720
class="aa-ItemActionButton"
718721
title="TEST FILL \\"cooktop\\""
722+
type="button"
719723
>
720724
<svg
721725
fill="currentColor"
@@ -764,6 +768,7 @@ describe('createQuerySuggestionsPlugin', () => {
764768
<button
765769
class="aa-ItemActionButton"
766770
title="TEST FILL \\"range\\""
771+
type="button"
767772
>
768773
<svg
769774
fill="currentColor"

packages/autocomplete-plugin-query-suggestions/src/getTemplates.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function getTemplates<TItem extends QuerySuggestionsHit>({
5252
</div>
5353
<div className="aa-ItemActions">
5454
<button
55+
type="button"
5556
className="aa-ItemActionButton"
5657
title={translations.fillQueryTitle(item.query)}
5758
onClick={(event) => {

packages/autocomplete-plugin-recent-searches/src/__tests__/createRecentSearchesPlugin.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ describe('createRecentSearchesPlugin', () => {
269269
<button
270270
class="aa-ItemActionButton"
271271
title="Remove this search"
272+
type="button"
272273
>
273274
<svg
274275
fill="currentColor"
@@ -282,6 +283,7 @@ describe('createRecentSearchesPlugin', () => {
282283
<button
283284
class="aa-ItemActionButton"
284285
title="Fill query with \\"query\\""
286+
type="button"
285287
>
286288
<svg
287289
fill="currentColor"
@@ -378,6 +380,7 @@ describe('createRecentSearchesPlugin', () => {
378380
<button
379381
class="aa-ItemActionButton"
380382
title="TEST REMOVE"
383+
type="button"
381384
>
382385
<svg
383386
fill="currentColor"
@@ -391,6 +394,7 @@ describe('createRecentSearchesPlugin', () => {
391394
<button
392395
class="aa-ItemActionButton"
393396
title="TEST FILL QUERY \\"query\\""
397+
type="button"
394398
>
395399
<svg
396400
fill="currentColor"
@@ -486,6 +490,7 @@ describe('createRecentSearchesPlugin', () => {
486490
<button
487491
class="aa-ItemActionButton"
488492
title="TEST REMOVE"
493+
type="button"
489494
>
490495
<svg
491496
fill="currentColor"
@@ -499,6 +504,7 @@ describe('createRecentSearchesPlugin', () => {
499504
<button
500505
class="aa-ItemActionButton"
501506
title="Fill query with \\"query\\""
507+
type="button"
502508
>
503509
<svg
504510
fill="currentColor"

packages/autocomplete-plugin-recent-searches/src/getTemplates.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export function getTemplates<TItem extends RecentSearchesItem>({
4444
</div>
4545
<div className="aa-ItemActions">
4646
<button
47+
type="button"
4748
className="aa-ItemActionButton"
4849
title={translations.removeSearchTitle}
4950
onClick={(event) => {
@@ -57,6 +58,7 @@ export function getTemplates<TItem extends RecentSearchesItem>({
5758
</svg>
5859
</button>
5960
<button
61+
type="button"
6062
className="aa-ItemActionButton"
6163
title={translations.fillQueryTitle(item.label)}
6264
onClick={(event) => {

packages/autocomplete-plugin-tags/src/__tests__/createTagsPlugin.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe('createTagsPlugin', () => {
7474
<button
7575
class="aa-TagsPlugin-RemoveButton"
7676
title="Remove this tag"
77+
type="button"
7778
>
7879
<svg
7980
fill="none"

packages/autocomplete-plugin-tags/src/createTagsPlugin.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export function createTagsPlugin<
131131
<div className="aa-TagsPlugin-Tag">
132132
<span className="aa-TagsPlugin-TagLabel">{item.label}</span>
133133
<button
134+
type="button"
134135
className="aa-TagsPlugin-RemoveButton"
135136
title="Remove this tag"
136137
>

0 commit comments

Comments
 (0)