[PR #727] [MERGED] Fix the DropDown list when too close to the right screen edge #1028

Closed
opened 2026-03-04 01:09:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/727
Author: @dimonomid
Created: 4/24/2022
Status: Merged
Merged: 11/13/2022
Merged by: @rivo

Base: masterHead: dropdown-hor-alignment-fix


📝 Commits (1)

  • 14200b5 Fix the DropDown list when too close to the right screen edge

📊 Changes

1 file changed (+10 additions, -2 deletions)

View changed files

📝 dropdown.go (+10 -2)

📄 Description

There was a bug: DropDown always aligns the left edge of selection list and the main widget, but when the widget is too close to the right screen edge, the list ends up being drawn only partially. See screenshot: here, "Menu" is the dropdown:

image

This is how it looks after the fix:

image

When there is enough room on the right side, dropdown list is drawn exactly as it used to.

Fixes #726.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rivo/tview/pull/727 **Author:** [@dimonomid](https://github.com/dimonomid) **Created:** 4/24/2022 **Status:** ✅ Merged **Merged:** 11/13/2022 **Merged by:** [@rivo](https://github.com/rivo) **Base:** `master` ← **Head:** `dropdown-hor-alignment-fix` --- ### 📝 Commits (1) - [`14200b5`](https://github.com/rivo/tview/commit/14200b58af89cfe28e9a98e7e43224dbdc4f34b5) Fix the DropDown list when too close to the right screen edge ### 📊 Changes **1 file changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `dropdown.go` (+10 -2) </details> ### 📄 Description There was a bug: DropDown always aligns the left edge of selection list and the main widget, but when the widget is too close to the right screen edge, the list ends up being drawn only partially. See screenshot: here, "Menu" is the dropdown: ![image](https://user-images.githubusercontent.com/1329932/164967688-f436e783-5010-4839-a4ec-d6baba2a7c18.png) This is how it looks after the fix: ![image](https://user-images.githubusercontent.com/1329932/164967605-c806a1b5-cd6d-4a36-a81e-c1fa2d084e43.png) When there is enough room on the right side, dropdown list is drawn exactly as it used to. Fixes #726. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:09:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#1028
No description provided.