Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(legacy): InputTime has broken support of native date picker #9540

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

nsbarsukov
Copy link
Member

@nsbarsukov nsbarsukov commented Oct 18, 2024

Reproduction

Open https://taiga-ui.dev/next/components/input-time#native using any mobile device
bug-demo

Also, there is error inside console:

ERROR TypeError: Cannot read properties of undefined (reading 'length')
    at get value (native-time.component.ts:46:58)
    at TuiNativeTimeComponent_HostBindings (native-time.component.ts:34:15)
    at processHostBindingOpCodes (core.mjs:11853:21)
    at refreshView (core.mjs:13544:9)
    at detectChangesInView (core.mjs:13663:9)
    at detectChangesInEmbeddedViews (core.mjs:13606:13)
    at refreshView (core.mjs:13522:9)
    at detectChangesInView (core.mjs:13663:9)
    at detectChangesInEmbeddedViews (core.mjs:13606:13)
    at refreshView (core.mjs:13522:9)

Bug reasons

<ng-template #iconContent>
<tui-icon
*polymorpheusOutlet="icon as src; context: {$implicit: size}"
tuiAppearance="icon"
[class.t-icon_small]="size === 's'"
[icon]="src.toString()"
/>
<input
*ngIf="showNativePicker"
tuiTime
/>
</ng-template>

is placed inside

For the modern Angular it means that it inherits injector of <tui-primitive-textfield  />.
So, the TEXTFIELD_HOST for [inputTime]-directive is TuiPrimitiveTextfieldDirective

@Directive({
standalone: false,
selector: 'tui-primitive-textfield',
providers: [tuiAsTextfieldHost(TuiPrimitiveTextfieldDirective)],
})
export class TuiPrimitiveTextfieldDirective extends AbstractTuiTextfieldHost<any> {

and not TuiInputTimeDirective

@Directive({
standalone: false,
selector: 'tui-input-time',
providers: [tuiAsTextfieldHost(TuiInputTimeDirective)],
})
export class TuiInputTimeDirective extends AbstractTuiTextfieldHost<TuiInputTimeComponent> {

@nsbarsukov nsbarsukov self-assigned this Oct 18, 2024
@nsbarsukov nsbarsukov requested a review from a team as a code owner October 18, 2024 09:51
@nsbarsukov nsbarsukov requested review from MarsiBarsi, waterplea, vladimirpotekhin and mdlufy and removed request for a team October 18, 2024 09:51
Copy link

lumberjack-bot bot commented Oct 18, 2024

Pull request was closed ✔️

All saved screenshots (for current PR) were deleted 🗑️

Copy link
Contributor

Visit the preview URL for this PR (updated for commit e40ea94):

https://taiga-previews--pr9540-input-time-fix-jsjpqeb1.web.app

(expires Sat, 19 Oct 2024 09:55:07 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 20bbff1ad19772ecf9c5134a84c0641b0d776f4a

Copy link

bundlemon bot commented Oct 18, 2024

BundleMon

Files updated (1)
Status Path Size Limits
demo/browser/main.(hash).js
295.23KB (+20B +0.01%) +10%
Unchanged files (4)
Status Path Size Limits
demo/browser/vendor.(hash).js
255.66KB +10%
demo/browser/runtime.(hash).js
43.17KB +10%
demo/browser/styles.(hash).css
16.27KB +10%
demo/browser/polyfills.(hash).js
11.18KB +10%

Total files change +20B 0%

Groups updated (1)
Status Path Size Limits
demo/browser/*..js
7.16MB (+20B 0%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@waterplea waterplea merged commit 049b289 into main Oct 18, 2024
28 checks passed
@waterplea waterplea deleted the input-time-fix branch October 18, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants