Skip to content

Commit

Permalink
fix(tags): use proper type on default template remove button (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab authored Jan 6, 2025
1 parent 67d0fce commit c52c5d5
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function TagItem({ label, remove }: Tag) {
<div className="aa-Tag">
<span className="aa-TagLabel">{label}</span>
<button
type="button"
className="aa-TagRemoveButton"
onClick={() => remove()}
title="Remove this tag"
Expand Down
1 change: 1 addition & 0 deletions examples/query-suggestions-with-inline-categories/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const querySuggestionsPlugin = createQuerySuggestionsPlugin({

<div className="aa-ItemActions">
<button
type="button"
className="aa-ItemActionButton"
title={`Fill query with "${item.query}"`}
onClick={(event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export function createLocalStorageRecentlyViewedItems<
</div>
<div className="aa-ItemActions">
<button
type="button"
className="aa-ItemActionButton"
title="Remove this search"
onClick={(event) => {
Expand Down
1 change: 1 addition & 0 deletions examples/tags-in-searchbox/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function TagItem<TTag>({ label, remove }: TagItemProps<TTag>) {
<div className="aa-Tag">
<span className="aa-TagLabel">{label}</span>
<button
type="button"
className="aa-TagRemoveButton"
onClick={() => remove()}
title="Remove this tag"
Expand Down
1 change: 1 addition & 0 deletions examples/two-column-layout/src/plugins/productsPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ function ProductItem({ hit, components }: ProductItemProps) {
</div>

<button
type="button"
className="aa-ItemFavorite"
onClick={(event) => {
event.preventDefault();
Expand Down
2 changes: 2 additions & 0 deletions examples/voice-search/voiceSearchPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export function createVoiceSearchPlugin({
function VoiceSearchButton({ onClick }) {
return (
<button
type="button"
className="aa-VoiceSearchButton"
title="Voice Search"
onClick={(event) => {
Expand Down Expand Up @@ -143,6 +144,7 @@ function VoiceSearchOverlay({ status, transcript, onCancel }) {
<div className="aa-VoiceSearchWrapper">
<div>{transcript || getStatusText(status)}</div>
<button
type="button"
className="aa-VoiceSearchListeningButton"
onClick={(event) => {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ describe('createQuerySuggestionsPlugin', () => {
<button
class="aa-ItemActionButton"
title="Fill query with \\"cooktop\\""
type="button"
>
<svg
fill="currentColor"
Expand Down Expand Up @@ -208,6 +209,7 @@ describe('createQuerySuggestionsPlugin', () => {
<button
class="aa-ItemActionButton"
title="Fill query with \\"range\\""
type="button"
>
<svg
fill="currentColor"
Expand Down Expand Up @@ -327,6 +329,7 @@ describe('createQuerySuggestionsPlugin', () => {
<button
class="aa-ItemActionButton"
title="Fill query with \\"range\\""
type="button"
>
<svg
fill="currentColor"
Expand Down Expand Up @@ -716,6 +719,7 @@ describe('createQuerySuggestionsPlugin', () => {
<button
class="aa-ItemActionButton"
title="TEST FILL \\"cooktop\\""
type="button"
>
<svg
fill="currentColor"
Expand Down Expand Up @@ -764,6 +768,7 @@ describe('createQuerySuggestionsPlugin', () => {
<button
class="aa-ItemActionButton"
title="TEST FILL \\"range\\""
type="button"
>
<svg
fill="currentColor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function getTemplates<TItem extends QuerySuggestionsHit>({
</div>
<div className="aa-ItemActions">
<button
type="button"
className="aa-ItemActionButton"
title={translations.fillQueryTitle(item.query)}
onClick={(event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ describe('createRecentSearchesPlugin', () => {
<button
class="aa-ItemActionButton"
title="Remove this search"
type="button"
>
<svg
fill="currentColor"
Expand All @@ -282,6 +283,7 @@ describe('createRecentSearchesPlugin', () => {
<button
class="aa-ItemActionButton"
title="Fill query with \\"query\\""
type="button"
>
<svg
fill="currentColor"
Expand Down Expand Up @@ -378,6 +380,7 @@ describe('createRecentSearchesPlugin', () => {
<button
class="aa-ItemActionButton"
title="TEST REMOVE"
type="button"
>
<svg
fill="currentColor"
Expand All @@ -391,6 +394,7 @@ describe('createRecentSearchesPlugin', () => {
<button
class="aa-ItemActionButton"
title="TEST FILL QUERY \\"query\\""
type="button"
>
<svg
fill="currentColor"
Expand Down Expand Up @@ -486,6 +490,7 @@ describe('createRecentSearchesPlugin', () => {
<button
class="aa-ItemActionButton"
title="TEST REMOVE"
type="button"
>
<svg
fill="currentColor"
Expand All @@ -499,6 +504,7 @@ describe('createRecentSearchesPlugin', () => {
<button
class="aa-ItemActionButton"
title="Fill query with \\"query\\""
type="button"
>
<svg
fill="currentColor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function getTemplates<TItem extends RecentSearchesItem>({
</div>
<div className="aa-ItemActions">
<button
type="button"
className="aa-ItemActionButton"
title={translations.removeSearchTitle}
onClick={(event) => {
Expand All @@ -57,6 +58,7 @@ export function getTemplates<TItem extends RecentSearchesItem>({
</svg>
</button>
<button
type="button"
className="aa-ItemActionButton"
title={translations.fillQueryTitle(item.label)}
onClick={(event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('createTagsPlugin', () => {
<button
class="aa-TagsPlugin-RemoveButton"
title="Remove this tag"
type="button"
>
<svg
fill="none"
Expand Down
1 change: 1 addition & 0 deletions packages/autocomplete-plugin-tags/src/createTagsPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export function createTagsPlugin<
<div className="aa-TagsPlugin-Tag">
<span className="aa-TagsPlugin-TagLabel">{item.label}</span>
<button
type="button"
className="aa-TagsPlugin-RemoveButton"
title="Remove this tag"
>
Expand Down

0 comments on commit c52c5d5

Please sign in to comment.