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

BUG | scale-dropdown-select | hiddenInput is defined #2303

Closed
mato-a opened this issue Mar 25, 2024 · 3 comments
Closed

BUG | scale-dropdown-select | hiddenInput is defined #2303

mato-a opened this issue Mar 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mato-a
Copy link
Contributor

mato-a commented Mar 25, 2024

Scale Version
3.0.0-beta.150

Framework and version
Angular 17.2.0

Current Behavior

TypeError: this.hiddenInput is undefined
    updateInputHidden scale-dropdown-select_13.entry.js:295
    valueChange scale-dropdown-select_13.entry.js:256
    setValue index-6d95a4bc.js:1542
    setValue index-6d95a4bc.js:1539
    set index-6d95a4bc.js:1579
    Angular 4
    RanInputDropdownComponent_Template ran-input-dropdown.component.ts:16
    Angular 48
    RxJS 6
    Angular 20
    RxJS 44
 
<scale-dropdown-select ng-reflect-form="[object Object]">
[index-6d95a4bc.js:2023:51](webpack:///node_modules/@telekom/scale-components/dist/esm/index-6d95a4bc.js)
ERROR Error: NG01203: No value accessor for form control unspecified name attribute. Find more at https://angular.io/errors/NG01203
    Angular 11
    RanInputDropdownComponent_Template ran-input-dropdown.component.ts:24
    Angular 48
    RxJS 6
    Angular 20
    RxJS 43

Expected Behavior
no errors in console, hiddenInput is defined

Code Reproduction

      <scale-dropdown-select
        [formControl]="control"
        [label]="translationKey | translate"
        [invalid]="isInvalid"
        [helperText]="isInvalid ? ('INVALID' | translate) : ''"
        [value]="control.value"
        [id]="key"
        [name]="key"
      >
        <scale-dropdown-select-item *ngFor="let val of values" [value]="val.value">
          <span>{{ val.value }}</span>
          <span *ngIf="val.description"> ({{ val.description }})</span>
        </scale-dropdown-select-item>
        >
      </scale-dropdown-select>

Additional context
Because hiddenInput is not defined, also name prop on input is not defined which prevents formControl accessor to work properly in Angular.

@mato-a mato-a added the bug Something isn't working label Mar 25, 2024
@tshimber
Copy link
Contributor

hi @mato-a ! please tell, if the issue is still relevant. I'm not familiar with the topic, after short investigation I only understood, that this hiddenInput is a workaround, which is needed for this version of Stencil. it is created and appended on componentDidLoad hook for every scale select. and for me it works: i see hiddenInput in DOM, no errors in console. maybe you could provide ts part as well so i could try to reproduce? or maybe you have an idea, why in your case hiddenInput is not being created?

image

@mato-a
Copy link
Contributor Author

mato-a commented Sep 11, 2024

Hi @tshimber,

Thanks for taking interest in this, but I can't reproduce it anymore.

I've reported this bug half a year ago and I don't really remember it... I've checked our codebase and we actually don't use scale-dropdown-select anymore... instead we use deprecated scale-dropdown in few places...

So from my point of view it is not relevant anymore and I'll close the ticket.

@mato-a mato-a closed this as completed Sep 11, 2024
@tshimber
Copy link
Contributor

@mato-a thank you! i'll keep in mind this issue in case smth relatable appears👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants