Skip to content

Commit

Permalink
Add horizontal resizability to autocomplete popup (elastic#180243)
Browse files Browse the repository at this point in the history
## Summary

This PR adds horizontal resizability to the autocomplete popup. The
resized width does not persist, so it returns to the default on every
load.

Closes elastic#171268
Closes elastic#125186

### CSS resizer on Safari

The CSS resizer behaves uniquely on Safari. You can't resize an element
if another element overlaps the resizer like this.

```html
data:text/html,<div%20style="position:fixed;width:280px;height:128px;resize:both;border:solid%201px;overflow:hidden;"><div%20style="position:absolute;right:0px;bottom:0px;">FOO<div></div>
```

The workaround is to set a negative z-index to the overlapping element
like this.

```html
data:text/html,<div%20style="position:fixed;width:280px;height:128px;resize:both;border:solid%201px;overflow:hidden;"><div%20style="position:absolute;right:0px;bottom:0px;z-index:-1;">FOO<div></div>
```

## Release note

Adds horizontal resizability to the autocomplete popup on the Dev Tools
Console

---------

Co-authored-by: Michael Marcialis <[email protected]>
  • Loading branch information
sakurai-youhei and MichaelMarcialis authored Apr 27, 2024
1 parent 8cc7550 commit 0f375e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/plugins/console/public/styles/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@

@import 'app';
@import 'components/index';

.ace_editor.ace_autocomplete {
resize: horizontal;

// These negative z-index's ensure to expose the resizer on Safari.
.ace_scroller {
z-index: -1;
}
.ace_scrollbar.ace_scrollbar-v {
z-index: -1;
}
}

0 comments on commit 0f375e3

Please sign in to comment.