Skip to content

Commit

Permalink
[Security Solution] Change handling whitespace for textarea autoheigh…
Browse files Browse the repository at this point in the history
…t to `pre` (elastic#203993)

**Resolves: elastic#178615**

## Summary

Change the way kbnQueryBar__textarea--autoHeight css class handles the
whitespace. Instead of `normal` use `pre`. This improves the
behavior for long pre-formatted texts in the query field in Firefox. It doesn't affect
Chrome nor Safari.


## BEFORE
### Chrome 
<img width="1013" alt="image"
src="https://github.com/user-attachments/assets/c56be529-b55d-4170-a6d1-4d7b01d98b3e"
/>

### Safari
<img width="925" alt="image"
src="https://github.com/user-attachments/assets/2697c72f-a063-49b8-8501-80e90ef0733f"
/>

### Firefox **(the issue is here)**
<img width="927" alt="image"
src="https://github.com/user-attachments/assets/ed896f71-5303-4ef4-9899-3d46b3e99af7"
/>


## AFTER
### Chrome
<img width="1014" alt="image"
src="https://github.com/user-attachments/assets/71259eb8-c984-4c7f-99a7-d4f528568f3b"
/>

### Safari
<img width="942" alt="image"
src="https://github.com/user-attachments/assets/998499a4-6480-4407-8e40-a897c0d2e7b8"
/>

### Firefox **(Note that the issue is gone)**
<img width="924" alt="image"
src="https://github.com/user-attachments/assets/f79f86d5-726d-4f7d-9c06-d2e003cfcd97"
/>

Note: please notice that for some reason, with this setting, Firefox
additionally presents the whole text at the bottom as one line. But that
should be OK.
<img width="831" alt="image"
src="https://github.com/user-attachments/assets/43198645-7d3e-4f74-a59e-9577531349a6"
/>
  • Loading branch information
jkelas authored Dec 13, 2024
1 parent 0eb8322 commit e287528
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
&.kbnQueryBar__textarea--autoHeight {
overflow-x: auto;
overflow-y: auto;
white-space: normal;
white-space: pre;
max-height: calc(35vh - 100px);
min-height: $euiFormControlHeight;
}
Expand Down

0 comments on commit e287528

Please sign in to comment.