Skip to content

Commit

Permalink
Merge pull request #1353 from livechat/main
Browse files Browse the repository at this point in the history
New Release
  • Loading branch information
VadymBezpalko authored Sep 17, 2024
2 parents 59c6a88 + a2c12ca commit eec431f
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": ["packages/*"],
"version": "1.38.1",
"version": "1.38.2",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/example-react/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "example-react",
"private": true,
"version": "1.38.1",
"version": "1.38.2",
"scripts": {
"start": "vite --open",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@livechat/design-system-icons": "^1.38.1",
"@livechat/design-system-react-components": "^1.38.1",
"@livechat/design-system-icons": "^1.38.2",
"@livechat/design-system-react-components": "^1.38.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@livechat/design-system-icons",
"version": "1.38.1",
"version": "1.38.2",
"description": "",
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/metrics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@livechat/design-system-metrics",
"version": "1.38.1",
"version": "1.38.2",
"description": "",
"scripts": {
"prebuild": "rm -rf dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@livechat/design-system-react-components",
"version": "1.38.1",
"version": "1.38.2",
"description": "",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -73,7 +73,7 @@
"dependencies": {
"@floating-ui/react": "^0.26.4",
"@livechat/data-utils": "^0.2.16",
"@livechat/design-system-icons": "^1.38.1",
"@livechat/design-system-icons": "^1.38.2",
"clsx": "^1.1.1",
"date-fns": "^2.28.0",
"lodash.debounce": "^4.0.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,25 @@ export const Examples = (): React.ReactElement => {
single
/>
</StoryDescriptor>

<StoryDescriptor title="Don't hide exact matches">
<AutoComplete
options={['Option 1']}
placeholder={placeholderText}
hideIfExactMatch={false}
/>
</StoryDescriptor>
<StoryDescriptor title="In a form">
<form
onSubmit={(e) => {
e.preventDefault();
// eslint-disable-next-line no-console
console.log('submit');
}}
>
<AutoComplete options={options} placeholder={placeholderText} />
</form>
</StoryDescriptor>
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ export const AutoComplete = React.forwardRef<
};

const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
handleVisibilityChange(true);
if (virtualItemRef.current?.id && event.key === 'Enter') {
const isEnterKey = event.key === 'Enter';
if (virtualItemRef.current?.id && isEnterKey) {
handleAutoComplete([{ key: virtualItemRef.current?.id }]);
event.preventDefault();
}
if (!isEnterKey) {
handleVisibilityChange(true);
}
inputProps.onKeyDown?.(event);
};
Expand Down

0 comments on commit eec431f

Please sign in to comment.