outl1ne / nova-simple-repeatable

A Laravel Nova simple repeatable rows field.
MIT License
73 stars 44 forks source link

Fields do not show in detail view if empty #11

Closed jerodion closed 3 years ago

jerodion commented 3 years ago

If the data is null it doesn't show the labels with the standard "-" representing empty values.

Screen Shot 2021-03-31 at 8 48 34 PM

jerodion commented 3 years ago

Also getting this error in dev console:

[Error] TypeError: undefined is not an object (evaluating 'this.field.rows[0].fields') — simple-repeatable:2:256734
    Xt (vendor.js:1:1036069)
    Ft (vendor.js:1:1035982)
    Ht (vendor.js:1:1035634)
    (anonymous function) (vendor.js:1:1059018)
    (anonymous function) (vendor.js:1:1092291)
    (anonymous function) (vendor.js:1:1050989)
    hn (vendor.js:1:1050906)
    (anonymous function) (vendor.js:1:1092258)
    init (vendor.js:1:1043753)
    (anonymous function) (vendor.js:1:1080635)
    d (vendor.js:1:1080910)
    h (vendor.js:1:1081499)
    d (vendor.js:1:1081025)
    (anonymous function) (vendor.js:1:1085042)
    (anonymous function) (vendor.js:1:1058033)
    (anonymous function) (vendor.js:1:1092281)
    (anonymous function) (vendor.js:1:1050989)
    hn (vendor.js:1:1050906)
    (anonymous function) (vendor.js:1:1092258)
    init (vendor.js:1:1043753)
    (anonymous function) (vendor.js:1:1080635)
    d (vendor.js:1:1080910)
    h (vendor.js:1:1081499)
    d (vendor.js:1:1081025)
    (anonymous function) (vendor.js:1:1085042)
    (anonymous function) (vendor.js:1:1058033)
    (anonymous function) (vendor.js:1:1092281)
    (anonymous function) (vendor.js:1:1050989)
    hn (vendor.js:1:1050906)
    (anonymous function) (vendor.js:1:1092258)
    init (vendor.js:1:1043753)
    (anonymous function) (vendor.js:1:1080635)
    d (vendor.js:1:1080910)
    h (vendor.js:1:1081499)
    d (vendor.js:1:1081025)
    (anonymous function) (vendor.js:1:1083770)
    w (vendor.js:1:1083953)
    (anonymous function) (vendor.js:1:1085089)
    (anonymous function) (vendor.js:1:1058016)
    (anonymous function) (vendor.js:1:1092281)
    (anonymous function) (vendor.js:1:1050989)
    (anonymous function) (vendor.js:1:1051872)
    fn (vendor.js:1:1049981)
    (anonymous function) (vendor.js:1:1036738)
    Gt (vendor.js:1:1036179)
    promiseReactionJob
jerodion commented 3 years ago

Nevermind this only happens if the database entry is an empty array [], not actually null.