Skip to content

[Dashboard] Don't make controls overflow outside of screen horizontally#260327

Merged
mbondyra merged 3 commits into
elastic:mainfrom
mbondyra:dashboard_controls_should_be_max_100_width
Mar 30, 2026
Merged

[Dashboard] Don't make controls overflow outside of screen horizontally#260327
mbondyra merged 3 commits into
elastic:mainfrom
mbondyra:dashboard_controls_should_be_max_100_width

Conversation

@mbondyra
Copy link
Copy Markdown
Contributor

@mbondyra mbondyra commented Mar 30, 2026

Summary

Fixes dashboard controls (small, medium, large sizes) overflowing horizontally outside their container when the container is narrower than the control's fixed width.

Problem: Controls with fixed widths (e.g., controlFrameWrapper--large = 800px) would overflow their container because minWidth takes precedence over maxWidth in CSS. Adding maxWidth: 100% doesn't work when minWidth is larger than the container.

Solution: Use CSS min() function for both width and minWidth to pick the smaller value between the fixed pixel width and 100% of the container:

  • controlFrameWrapper--small: min(224px, 100%)
  • controlFrameWrapper--medium: min(400px, 100%)
  • controlFrameWrapper--large: min(800px, 100%)

how to test

  1. Open a dashboard with controls in a narrow container (e.g., Dashboard Agent sidebar or just resize the window)
  2. Verify that large controls no longer overflow horizontally
  3. Verify that controls still maintain their intended widths when the container is wide enough

Before:
Screenshot 2026-03-30 at 20 46 07

After:
Screenshot 2026-03-30 at 20 45 15

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@mbondyra mbondyra requested a review from a team as a code owner March 30, 2026 18:47
@mbondyra mbondyra added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Mar 30, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@mbondyra mbondyra enabled auto-merge (squash) March 30, 2026 20:29
@mbondyra mbondyra merged commit 450e259 into elastic:main Mar 30, 2026
18 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
controls 526.1KB 526.2KB +78.0B
dashboard 845.9KB 846.0KB +78.0B
discover 1.6MB 1.6MB +78.0B
infra 1.3MB 1.3MB +78.0B
maps 3.2MB 3.2MB +78.0B
observability 2.2MB 2.2MB +78.0B
securitySolution 11.5MB 11.5MB +78.0B
slo 1.1MB 1.1MB +78.0B
triggersActionsUi 1.8MB 1.8MB +78.0B
total +702.0B

History

jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…ly (elastic#260327)

## Summary

Fixes dashboard controls (small, medium, large sizes) overflowing
horizontally outside their container when the container is narrower than
the control's fixed width.

**Problem:** Controls with fixed widths (e.g.,
`controlFrameWrapper--large` = 800px) would overflow their container
because `minWidth` takes precedence over `maxWidth` in CSS. Adding
`maxWidth: 100%` doesn't work when `minWidth` is larger than the
container.

**Solution:** Use CSS `min()` function for both `width` and `minWidth`
to pick the smaller value between the fixed pixel width and 100% of the
container:
  - `controlFrameWrapper--small`: `min(224px, 100%)`
  - `controlFrameWrapper--medium`: `min(400px, 100%)`
  - `controlFrameWrapper--large`: `min(800px, 100%)`

  ## how to test

1. Open a dashboard with controls in a narrow container (e.g., Dashboard
Agent sidebar or just resize the window)
  2. Verify that large controls no longer overflow horizontally
3. Verify that controls still maintain their intended widths when the
container is wide enough
  
Before:
<img width="642" height="555" alt="Screenshot 2026-03-30 at 20 46 07"
src="https://github.com/user-attachments/assets/0c9c4ef8-ce1e-4ae0-95e5-133be47667b3"
/>

After:
<img width="619" height="697" alt="Screenshot 2026-03-30 at 20 45 15"
src="https://github.com/user-attachments/assets/366f3260-c5d3-4b68-a089-13c8b7b08ea0"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…ly (elastic#260327)

## Summary

Fixes dashboard controls (small, medium, large sizes) overflowing
horizontally outside their container when the container is narrower than
the control's fixed width.

**Problem:** Controls with fixed widths (e.g.,
`controlFrameWrapper--large` = 800px) would overflow their container
because `minWidth` takes precedence over `maxWidth` in CSS. Adding
`maxWidth: 100%` doesn't work when `minWidth` is larger than the
container.

**Solution:** Use CSS `min()` function for both `width` and `minWidth`
to pick the smaller value between the fixed pixel width and 100% of the
container:
  - `controlFrameWrapper--small`: `min(224px, 100%)`
  - `controlFrameWrapper--medium`: `min(400px, 100%)`
  - `controlFrameWrapper--large`: `min(800px, 100%)`

  ## how to test

1. Open a dashboard with controls in a narrow container (e.g., Dashboard
Agent sidebar or just resize the window)
  2. Verify that large controls no longer overflow horizontally
3. Verify that controls still maintain their intended widths when the
container is wide enough
  
Before:
<img width="642" height="555" alt="Screenshot 2026-03-30 at 20 46 07"
src="https://github.com/user-attachments/assets/0c9c4ef8-ce1e-4ae0-95e5-133be47667b3"
/>

After:
<img width="619" height="697" alt="Screenshot 2026-03-30 at 20 45 15"
src="https://github.com/user-attachments/assets/366f3260-c5d3-4b68-a089-13c8b7b08ea0"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
@mbondyra mbondyra deleted the dashboard_controls_should_be_max_100_width branch May 6, 2026 08:18
stratoula added a commit that referenced this pull request May 6, 2026
## Summary

Fixes the regression created by
#260327.

in main 

<img width="2437" height="704" alt="image"
src="https://github.com/user-attachments/assets/668a8546-2e30-4360-9a49-a500baca6dfe"
/>

In this PR 

<img width="2034" height="575" alt="image"
src="https://github.com/user-attachments/assets/2045b122-f25b-4258-abcd-f09d1fbdebd8"
/>
kibanamachine added a commit that referenced this pull request May 6, 2026
# Backport

This will backport the following commits from `main` to `9.4`:
- [[Controls] Fix rendering in Discover
(#267886)](#267886)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT
[{"author":{"name":"Stratou","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2026-05-06T09:21:47Z","message":"[Controls]
Fix rendering in Discover (#267886)\n\n## Summary\n\nFixes the
regression created
by\nhttps://github.com//pull/260327.\n\nin main \n\n<img
width=\"2437\" height=\"704\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/668a8546-2e30-4360-9a49-a500baca6dfe\"\n/>\n\nIn
this PR \n\n<img width=\"2034\" height=\"575\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2045b122-f25b-4258-abcd-f09d1fbdebd8\"\n/>","sha":"3bc3664e4ea926fde79cae51b937d750eed3a43f","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:fix","Team:Presentation","backport:version","v9.4.0","v9.5.0"],"title":"[Controls]
Fix rendering in
Discover","number":267886,"url":"https://github.com/elastic/kibana/pull/267886","mergeCommit":{"message":"[Controls]
Fix rendering in Discover (#267886)\n\n## Summary\n\nFixes the
regression created
by\nhttps://github.com//pull/260327.\n\nin main \n\n<img
width=\"2437\" height=\"704\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/668a8546-2e30-4360-9a49-a500baca6dfe\"\n/>\n\nIn
this PR \n\n<img width=\"2034\" height=\"575\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2045b122-f25b-4258-abcd-f09d1fbdebd8\"\n/>","sha":"3bc3664e4ea926fde79cae51b937d750eed3a43f"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/267886","number":267886,"mergeCommit":{"message":"[Controls]
Fix rendering in Discover (#267886)\n\n## Summary\n\nFixes the
regression created
by\nhttps://github.com//pull/260327.\n\nin main \n\n<img
width=\"2437\" height=\"704\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/668a8546-2e30-4360-9a49-a500baca6dfe\"\n/>\n\nIn
this PR \n\n<img width=\"2034\" height=\"575\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2045b122-f25b-4258-abcd-f09d1fbdebd8\"\n/>","sha":"3bc3664e4ea926fde79cae51b937d750eed3a43f"}}]}]
BACKPORT-->

Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants