Skip to content

Commit 5631aa7

Browse files
Allow to set parameters of the outer div container of the CodeAutocompleteField
1 parent 33b9301 commit 5631aa7

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ This is a major release, and it might be not compatible with your current usage
1111
### Added
1212

1313
- Extended existing height and readOnly props from `CodeEditorProps` to `AutoSuggestionProps` & `ExtendedCodeEditorProps` to be configurable from `<CodeAutocompleteField />`
14+
- `<CodeAutocompleteField />:
15+
- outerDivAttributes parameter: Allows to set parameter of the container div element of the code complete field.
1416

1517
## [24.3.0] - 2025-06-05
1618

src/components/AutoSuggestion/AutoSuggestion.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ export interface AutoSuggestionProps {
170170
height?: number | string;
171171
/** Set read-only mode. Default: false */
172172
readOnly?: boolean;
173+
/** Properties that should be added to the outer div container. */
174+
outerDivAttributes?: Omit<React.HTMLAttributes<HTMLDivElement>, "id" | "data-test-id">;
173175
}
174176

175177
// Meta data regarding a request
@@ -202,8 +204,9 @@ const AutoSuggestion = ({
202204
mode,
203205
multiline = false,
204206
reInitOnInitialValueChange = false,
205-
height,
206-
readOnly
207+
height,
208+
readOnly,
209+
outerDivAttributes
207210
}: AutoSuggestionProps) => {
208211
const value = React.useRef<string>(initialValue);
209212
const cursorPosition = React.useRef(0);
@@ -681,6 +684,7 @@ const AutoSuggestion = ({
681684
id={id}
682685
ref={autoSuggestionDivRef}
683686
className={`${eccgui}-autosuggestion` + (className ? ` ${className}` : "")}
687+
{...outerDivAttributes}
684688
>
685689
<div
686690
className={` ${eccgui}-autosuggestion__inputfield ${BlueprintClassNames.INPUT_GROUP} ${

0 commit comments

Comments
 (0)