Commit f078ae95 authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Fix Telegram phone form: country select was overriding the number field's width

FIELD_CLASSES bakes in w-full (shared with Input/Textarea, which need it) -
appending w-32 after it in the same template string doesn't override it:
Tailwind utilities at equal specificity resolve by stylesheet order, not by
where they appear in a className string, and w-full was winning. The select
filled the row and squeezed the number input down to almost nothing. Fixed
with !w-28 (forces the override) plus overflow/ellipsis so a long option
like "+44 United Kingdom" doesn't stretch the closed box past that width.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent ec4958c6
Pipeline #1258 failed with stages
......@@ -244,7 +244,13 @@ export function TelegramLink() {
value={countryCode}
onChange={(e) => setCountryCode(e.target.value as CountryCode)}
aria-label="Country code"
className={`${FIELD_CLASSES} w-32 shrink-0`}
// FIELD_CLASSES bakes in w-full (shared with Input/Textarea, which want it) -
// !w-28 is needed to actually win; a plain w-28 after it in the string has no
// effect since Tailwind utilities at equal specificity resolve by stylesheet
// order, not by where they appear in this template string. overflow/ellipsis
// keeps a long option's text (e.g. "+44 United Kingdom") from stretching the
// closed select past that width - the full name is still there when open.
className={`${FIELD_CLASSES} !w-28 shrink-0 overflow-hidden text-ellipsis whitespace-nowrap`}
>
{COUNTRIES.map((c) => (
<option key={c.code} value={c.code}>
......@@ -261,7 +267,7 @@ export function TelegramLink() {
value={nationalNumber}
onChange={(e) => setNationalNumber(e.target.value)}
aria-label="Phone number"
className="flex-1"
className="min-w-0 flex-1"
/>
</div>
{error && <p className="text-sm text-error">{error}</p>}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment