diff --git a/macos/Sources/Helpers/TabTitleEditor.swift b/macos/Sources/Helpers/TabTitleEditor.swift index c1784112e..d63820643 100644 --- a/macos/Sources/Helpers/TabTitleEditor.swift +++ b/macos/Sources/Helpers/TabTitleEditor.swift @@ -226,7 +226,9 @@ final class TabTitleEditor: NSObject, NSTextFieldDelegate { if let sourceLabel { let labelFrame = tabButton.convert(sourceLabel.bounds, from: sourceLabel) - frame.origin.y = labelFrame.minY + /// The `labelFrame.minY` value changes unexpectedly after the first use, + /// I don't know exactly why, but `tabButton.bounds` appears stable enough to calculate the correct position reliably. + frame.origin.y = bounds.midY - labelFrame.height * 0.5 frame.size.height = labelFrame.height }