[Dashboard] Don't make controls overflow outside of screen horizontally#260327
Merged
mbondyra merged 3 commits intoMar 30, 2026
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
ThomThomson
approved these changes
Mar 30, 2026
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
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) - [ ] ...
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 becauseminWidthtakes precedence overmaxWidthin CSS. AddingmaxWidth: 100%doesn't work whenminWidthis larger than the container.Solution: Use CSS
min()function for bothwidthandminWidthto 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
Before:

After:

Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*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.