Skip to content

Commit

Permalink
fix(fuselage): show AutoComplete placeholder (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Mar 25, 2024
1 parent 3515540 commit cef61fd
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-oranges-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": patch
---

fix(fuselage): show `AutoComplete` placeholder
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default {
title: 'Inputs/AutoComplete',
component: AutoComplete,
parameters: {
layout: 'centered',
docs: {
description: {
component: 'An input for selection of options.',
Expand Down Expand Up @@ -108,3 +109,8 @@ CustomItem.args = {
/>
),
};

export const WithPlaceholder = Template.bind({});
WithPlaceholder.args = {
placeholder: 'Search...',
};
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function AutoComplete({
onFocus={show}
onKeyDown={handleKeyDown}
placeholder={
optionsAreVisible !== AnimatedVisibility.HIDDEN || !value
optionsAreVisible === AnimatedVisibility.HIDDEN || !value
? placeholder
: undefined
}
Expand Down Expand Up @@ -192,6 +192,7 @@ export function AutoComplete({
: 'magnifier'
}
size='x20'
color='default'
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports[`[AutoComplete Rendering] renders CustomItem without crashing 1`] = `
>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-4pvxx3"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-6vi44e"
>
</i>
Expand Down Expand Up @@ -119,7 +119,7 @@ v/L21v8BT/ZVoe1UItsAAAAASUVORK5CYII="
>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-4pvxx3"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-6vi44e"
>
</i>
Expand Down Expand Up @@ -150,7 +150,7 @@ exports[`[AutoComplete Rendering] renders Default without crashing 1`] = `
>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-4pvxx3"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-6vi44e"
>
</i>
Expand Down Expand Up @@ -217,7 +217,7 @@ exports[`[AutoComplete Rendering] renders Multiple without crashing 1`] = `
>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-4pvxx3"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-6vi44e"
>
</i>
Expand Down Expand Up @@ -414,7 +414,39 @@ v/L21v8BT/ZVoe1UItsAAAAASUVORK5CYII="
>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-4pvxx3"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-6vi44e"
>
</i>
</div>
</div>
</div>
</body>
`;

exports[`[AutoComplete Rendering] renders WithPlaceholder without crashing 1`] = `
<body>
<div>
<div
class="rcx-box rcx-box--full rcx-autocomplete rcx-css-t3n91h"
>
<div
class="rcx-box rcx-box--full rcx-css-6d871f"
role="group"
>
<input
aria-label="Decorator Label"
class="rcx-box rcx-box--full rcx-box--animated rcx-input-box--undecorated rcx-input-box rcx-css-trljwa rcx-css-rcil7k"
placeholder="Search..."
value=""
/>
</div>
<div
class="rcx-box rcx-box--full rcx-autocomplete__addon"
>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-magnifier rcx-icon rcx-css-6vi44e"
>
</i>
Expand Down

0 comments on commit cef61fd

Please sign in to comment.