vue-ctk-date-time-picker icon indicating copy to clipboard operation
vue-ctk-date-time-picker copied to clipboard

Fixes id equals to undefined string

Open KartoffelCheetah opened this issue 4 years ago • 2 comments

  1. Per README.md id is optional and defaults to undefined [1]. This causes a weird behaviour of string concatenation of undefined and results id's in the format similar to 'undefined-...'.

    Specifically:

    • undefined-wrapper
    • undefined-input
    • undefined-picker-container
    • undefined-picker-container-DatePicker
  2. When using multiple datepicker components on a html page this results in an invalid html because of duplicate ids.

[1] https://github.com/chronotruck/vue-ctk-date-time-picker#props-api

KartoffelCheetah avatar Dec 11 '20 15:12 KartoffelCheetah

Does this solve this:

Cannot read property 'id' of undefined

id: "".concat(_ctx.$attrs.id, "-wrapper"),

romulous75 avatar May 20 '22 00:05 romulous75

@romulous75

I do not really remember this well, but from the description I wrote there back then in 2020 this is not. It's for fixing the issue of creating duplicate id's when we do not define an id.

The error you are mentioning seems to indicate that $attrs is undefined. But I still reference $attrs in my code. You could try to do some debugging in the browser about _ctx.

KartoffelCheetah avatar May 20 '22 01:05 KartoffelCheetah