Skip to content

Commit

Permalink
fix: replace ComboBox's preferredSize with a size of zeroed width…
Browse files Browse the repository at this point in the history
… and height

It fixes an issue with an input field overflow.

See: https://github.com/JetBrains-Research/TestSpark/pull/343/files#r1781430743
  • Loading branch information
Vladislav Artiukhov committed Oct 4, 2024
1 parent a2b108e commit 9c76071
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,11 @@ class TestCasePanelBuilder(

sendButton.addActionListener { sendRequest() }

// Set the preferred size of the requestComboBox.
// The width is calculated by subtracting the combined heights of languageTextField, requestJLabel,
// sendButton, and a padding of 20 from languageTextField's preferred height.
requestComboBox.preferredSize = Dimension(
languageTextField.preferredSize.height - requestJLabel.preferredSize.height - sendButton.preferredSize.height - 20,
requestComboBox.preferredSize.height
)
/**
* The following code is a workaround for the issue with the ComboBox preferred size.
* See: https://github.com/JetBrains-Research/TestSpark/pull/343/files#r1781430743
*/
requestComboBox.preferredSize = Dimension(0, 0)
requestComboBox.isEditable = true

return panel
Expand Down

0 comments on commit 9c76071

Please sign in to comment.