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

Fixes id equals to undefined string #331

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

KartoffelCheetah
Copy link

  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

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 `id`s.

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

Does this solve this:

Cannot read property 'id' of undefined

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

@KartoffelCheetah
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants