New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@constructor-io/constructorio-ui-autocomplete

Package Overview
Dependencies
Maintainers
8
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@constructor-io/constructorio-ui-autocomplete - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

13

lib/cjs/hooks/useCioAutocomplete.js

@@ -59,3 +59,3 @@ "use strict";

const downshift = (0, useDownShift_1.default)({ setQuery, onChange, items, onSubmit, cioClient, previousQuery });
const { isOpen, getMenuProps, getLabelProps, openMenu, closeMenu } = downshift;
const { isOpen, getMenuProps, getLabelProps, openMenu, closeMenu, highlightedIndex } = downshift;
return {

@@ -89,3 +89,12 @@ query,

(_a = cioClient === null || cioClient === void 0 ? void 0 : cioClient.tracker) === null || _a === void 0 ? void 0 : _a.trackInputFocus();
}, className: 'cio-input', 'data-testid': 'cio-input', placeholder })),
}, className: 'cio-input', 'data-testid': 'cio-input', placeholder, onKeyDownCapture: ({ code }) => {
const isEnter = code === 'Enter';
const isUserInput = highlightedIndex < 0;
if (isOpen && isEnter && isUserInput && (query === null || query === void 0 ? void 0 : query.length)) {
if (onSubmit) {
onSubmit({ query });
}
cioClient === null || cioClient === void 0 ? void 0 : cioClient.tracker.trackSearchSubmit(query, { original_query: query });
}
} })),
getFormProps: () => ({

@@ -92,0 +101,0 @@ onSubmit: (event) => {

@@ -56,3 +56,3 @@ import { useState } from 'react';

const downshift = useDownShift({ setQuery, onChange, items, onSubmit, cioClient, previousQuery });
const { isOpen, getMenuProps, getLabelProps, openMenu, closeMenu } = downshift;
const { isOpen, getMenuProps, getLabelProps, openMenu, closeMenu, highlightedIndex } = downshift;
return {

@@ -100,2 +100,12 @@ query,

placeholder,
onKeyDownCapture: ({ code }) => {
const isEnter = code === 'Enter';
const isUserInput = highlightedIndex < 0;
if (isOpen && isEnter && isUserInput && query?.length) {
if (onSubmit) {
onSubmit({ query });
}
cioClient?.tracker.trackSearchSubmit(query, { original_query: query });
}
},
}),

@@ -102,0 +112,0 @@ getFormProps: () => ({

2

package.json
{
"name": "@constructor-io/constructorio-ui-autocomplete",
"version": "1.2.0",
"version": "1.2.1",
"description": "Constructor.io Autocomplete UI library for web applications",

@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc