Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ This is a major release, and it might be not compatible with your current usage
### Added

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

## [24.3.0] - 2025-06-05

Expand Down
8 changes: 6 additions & 2 deletions src/components/AutoSuggestion/AutoSuggestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ export interface AutoSuggestionProps {
height?: number | string;
/** Set read-only mode. Default: false */
readOnly?: boolean;
/** Properties that should be added to the outer div container. */
outerDivAttributes?: Omit<React.HTMLAttributes<HTMLDivElement>, "id" | "data-test-id">;
}

// Meta data regarding a request
Expand Down Expand Up @@ -202,8 +204,9 @@ const AutoSuggestion = ({
mode,
multiline = false,
reInitOnInitialValueChange = false,
height,
readOnly
height,
readOnly,
outerDivAttributes
}: AutoSuggestionProps) => {
const value = React.useRef<string>(initialValue);
const cursorPosition = React.useRef(0);
Expand Down Expand Up @@ -681,6 +684,7 @@ const AutoSuggestion = ({
id={id}
ref={autoSuggestionDivRef}
className={`${eccgui}-autosuggestion` + (className ? ` ${className}` : "")}
{...outerDivAttributes}
>
<div
className={` ${eccgui}-autosuggestion__inputfield ${BlueprintClassNames.INPUT_GROUP} ${
Expand Down