scania-digital-design-system/sdds

[Bug report]: sdds-text-field & sdds-text-are crash when value is set to null

Closed this issue · 1 comments

Requirements before reporting

  • No duplicated issue reported.
  • I have read the contribution guidelines.
  • I have checked the lastest version if the bug exist there. See all avaliable packages at npmJS.com
  • I have made sure that the issue comes from SDDS packages by removing SDDS from my project as a test.
  • I have followed the installation guide.

Package

@scania/tegel-old

Package versions

@scania/components@latest

Browser

Chrome

Framework

Angular

Version

No response

Reproduction steps

1.Create an sdds-text-field/sdds-text-area
2.Bind its value property to a variable which holds null
3.The component doesn't render

Code example

No response

Screenshots

image

image

Expected behaviour

Both components sdds-text-field/sdds-text-area should be able to render null values and render an empty component when this happens. There are many situations where models will hold null values which are different to empty strings.

*This bug happens because in many places of the component code there is no null protection (just add a simple ? and ?? 0) when acessing the value property.

Console errors

Add warning/error message

Contact information

thiago.oliveira@scania.com

AB#2445