Skip to content

Commit

Permalink
[8.x] [Observability AI Assistant] Input box can be resized off-scree…
Browse files Browse the repository at this point in the history
…n (elastic elastic#181408) (elastic#197063) (elastic#198291)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Observability AI Assistant] Input box can be resized off-screen
(elastic elastic#181408)
(elastic#197063)](elastic#197063)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Arturo
Lidueña","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T10:45:28Z","message":"[Observability
AI Assistant] Input box can be resized off-screen (elastic elastic#181408)
(elastic#197063)\n\nfixes
[181408](https://github.com/elastic/kibana/issues/181408)\r\n\r\n##
Summary\r\n\r\nThis PR addresses the issue where the Observability AI
Assistant input\r\nbox can be resized outside the boundaries of the
browser window. Allows\r\nthe input box to resize dynamically while
ensuring it remains usable,\r\neven when the cursor moves outside the
screen during
resizing.","sha":"731c5a4b091bfe27968b75e42e62b249acbb045c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-minor","Team:Obs
AI Assistant"],"title":"[Observability AI Assistant] Input box can be
resized off-screen (elastic
elastic#181408)","number":197063,"url":"https://github.com/elastic/kibana/pull/197063","mergeCommit":{"message":"[Observability
AI Assistant] Input box can be resized off-screen (elastic elastic#181408)
(elastic#197063)\n\nfixes
[181408](https://github.com/elastic/kibana/issues/181408)\r\n\r\n##
Summary\r\n\r\nThis PR addresses the issue where the Observability AI
Assistant input\r\nbox can be resized outside the boundaries of the
browser window. Allows\r\nthe input box to resize dynamically while
ensuring it remains usable,\r\neven when the cursor moves outside the
screen during
resizing.","sha":"731c5a4b091bfe27968b75e42e62b249acbb045c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197063","number":197063,"mergeCommit":{"message":"[Observability
AI Assistant] Input box can be resized off-screen (elastic elastic#181408)
(elastic#197063)\n\nfixes
[181408](https://github.com/elastic/kibana/issues/181408)\r\n\r\n##
Summary\r\n\r\nThis PR addresses the issue where the Observability AI
Assistant input\r\nbox can be resized outside the boundaries of the
browser window. Allows\r\nthe input box to resize dynamically while
ensuring it remains usable,\r\neven when the cursor moves outside the
screen during
resizing.","sha":"731c5a4b091bfe27968b75e42e62b249acbb045c"}}]}]
BACKPORT-->

Co-authored-by: Arturo Lidueña <[email protected]>
  • Loading branch information
kibanamachine and arturoliduena authored Oct 30, 2024
1 parent 3feea7b commit c4f8a28
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ export function PromptEditorNaturalLanguage({
}
}, [handleResizeTextArea, prompt]);

useEffect(() => {
// Attach the event listener to the window to catch mouseup outside the browser window
window.addEventListener('mouseup', handleResizeTextArea);

return () => {
window.removeEventListener('mouseup', handleResizeTextArea);
};
}, [handleResizeTextArea]);

return (
<EuiInputPopover
display="flex"
Expand Down

0 comments on commit c4f8a28

Please sign in to comment.