@abgov/jsonforms-components 1.45.1 → 1.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.esm.js +13 -1
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -8120,7 +8120,7 @@ const AddressLookUpControl = props => {
8120
8120
  const dropdownRef = useRef(null);
8121
8121
  const handleInputChange = (field, value) => {
8122
8122
  var _a, _b;
8123
- if (field === 'addressLine1' && searchTerm.length < 3) {
8123
+ if (field === 'addressLine1') {
8124
8124
  setDropdownSelected(false);
8125
8125
  }
8126
8126
  let newAddress;
@@ -8191,6 +8191,18 @@ const AddressLookUpControl = props => {
8191
8191
  setSuggestions([]);
8192
8192
  setOpen(false);
8193
8193
  };
8194
+ useEffect(() => {
8195
+ var _a;
8196
+ if (dropdownRef.current && selectedIndex !== -1) {
8197
+ const activeItem = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`li[data-index="${selectedIndex}"]`);
8198
+ if (activeItem) {
8199
+ activeItem.scrollIntoView({
8200
+ behavior: 'smooth',
8201
+ block: 'nearest'
8202
+ });
8203
+ }
8204
+ }
8205
+ }, [selectedIndex]);
8194
8206
  const handleKeyDown = (e, value, key) => {
8195
8207
  var _a;
8196
8208
  if (key === 'ArrowDown') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.45.1",
3
+ "version": "1.46.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",