From 7f10a1986a5db7422ab0c78884950accc99268e3 Mon Sep 17 00:00:00 2001 From: Will Tidwell Date: Fri, 6 Feb 2026 11:04:55 -0500 Subject: [PATCH 1/2] allow example text --- .../phone-field/phone-field.component.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts b/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts index 282e82c7ee..fccecb3468 100644 --- a/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts +++ b/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts @@ -270,6 +270,19 @@ export class SkyPhoneFieldComponent implements OnDestroy, OnInit { return this.#_selectedCountry; } + /** + * Whether phone number example format hints are shown in the input help text. + * @default true + */ + @Input() + public set allowExampleText(value: boolean | undefined) { + this.#_allowExampleText = value !== false; + } + + public get allowExampleText(): boolean { + return this.#_allowExampleText; + } + @ViewChild('inputTemplateRef', { read: TemplateRef, static: true, @@ -302,6 +315,8 @@ export class SkyPhoneFieldComponent implements OnDestroy, OnInit { #_selectedCountry: SkyPhoneFieldCountry | undefined; + #_allowExampleText = true; + #countrySearchFormControl = new FormControl< SkyCountryFieldCountry | undefined | null >(undefined); @@ -588,7 +603,11 @@ export class SkyPhoneFieldComponent implements OnDestroy, OnInit { } #populateInputBoxHelpText(): void { - if (this.inputBoxHostSvc && this.inputTemplateRef) { + if ( + this.inputBoxHostSvc && + this.inputTemplateRef && + this.#_allowExampleText + ) { this.inputBoxHostSvc?.setHintText( this.#appFormat.formatText( this.#phoneNumberFormatHintTextTemplateString, From 4fbe51aa22dc0afb7d42713a5b30ab041fc4e67b Mon Sep 17 00:00:00 2001 From: Will Tidwell Date: Fri, 6 Feb 2026 15:24:36 -0500 Subject: [PATCH 2/2] adjustment --- .../lib/modules/phone-field/phone-field.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts b/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts index fccecb3468..08ac1e1a85 100644 --- a/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts +++ b/libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts @@ -276,7 +276,15 @@ export class SkyPhoneFieldComponent implements OnDestroy, OnInit { */ @Input() public set allowExampleText(value: boolean | undefined) { - this.#_allowExampleText = value !== false; + const newValue = value !== false; + if (this.#_allowExampleText !== newValue) { + this.#_allowExampleText = newValue; + if (!newValue && this.inputBoxHostSvc) { + this.inputBoxHostSvc.setHintText(undefined); + } else { + this.#populateInputBoxHelpText(); + } + } } public get allowExampleText(): boolean {