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

DatePicker error and rendering issues #124

Open
gRoberts84 opened this issue Aug 1, 2023 · 1 comment
Open

DatePicker error and rendering issues #124

gRoberts84 opened this issue Aug 1, 2023 · 1 comment
Labels
bug Something isn't working stale

Comments

@gRoberts84
Copy link

Laravel Form Components Version

v8.1

Laravel Version

9.52.12

Alpine Version

3.12.3

Bug description

datePicker component loses reference to the input after initialisation.

Uncaught TypeError: Cannot convert undefined or null to object
    at slice (<anonymous>)
    at _flatpickr (index.js:1979:10)
    at flatpickr (index.js:2018:16)
    at date-picker.js:28:43
_flatpickr @ index.js:1979
flatpickr @ index.js:2018
(anonymous) @ date-picker.js:28

this.$refs.__input is populated when first rendering the page but when changing anything else on the page that causes a render, it becomes undefined and throws an error.

queueMicrotask(() => {
    this.__ready = true;

    this.__flatpickr = window.flatpickr(this.$refs.__input, this.__config());
});

It is also randomly showing the clear button when not active?

image

Steps to reproduce

Using the following:

<x-date-picker name="date" wire:model="date" :allow-input="false" format="d/m/Y" placeholder="dd/mm/yyyy" />

Relevant log output

No response

@gRoberts84 gRoberts84 added the bug Something isn't working label Aug 1, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 22, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2023
@rawilk rawilk reopened this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants