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::make('date')->native(false) bug when using wire:loading wire:target #15084

Closed
dharen008 opened this issue Dec 13, 2024 · 15 comments
Closed
Labels
Milestone

Comments

@dharen008
Copy link

dharen008 commented Dec 13, 2024

Package

filament/filament

Package Version

3.2.130

Laravel Version

11.35.1

Livewire Version

3.5.17

PHP Version

8.2

Problem description

In my demo repository, I replicated the issue on the holiday resource.

The problem occurs with DatePicker::make('date')->native(false) when using wire:loading wire:target along with live().
Once wire:loading wire:target completes, the date picker calendar disappears.
Please refer to the Steps to Reproduce section to replicate the issue.

image

Expected behavior

  1. The date picker calendar should function consistently regardless of the order of actions.
  2. Whether the user clicks the date field first or inputs a value in the name field first, the calendar numbers should always display correctly after wire:loading completes.

Steps to reproduce

For context: I added a disabled state to the date field if the name field is empty.

Follow these scenarios:

Scenario 1: Working

  1. Click the date field to display the calendar.
  2. Input a value in the name field.
  3. Wait for wire:loading to complete.
  4. Observe that the date field works as expected.

Scenario 2: Not Working

  1. Input a value in the name field first.
  2. Wait for wire:loading to finish.
  3. Click the date field to display the calendar.
  4. Observe that the calendar numbers do not display.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/dharen008/demo

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@github-project-automation github-project-automation bot moved this to Todo in Roadmap Dec 13, 2024
@danharrin danharrin added this to the v3 milestone Dec 14, 2024
@egekibar
Copy link

same

@biimix
Copy link

biimix commented Dec 15, 2024

same here

@bartvantuijn
Copy link

same

@dreftas
Copy link
Contributor

dreftas commented Dec 16, 2024

I can confirm this too.

@nathanmay
Copy link

Also getting the same issue.

@davideprevosto
Copy link

Unfortunately I am getting the same issue. There aren't JavaScript errors on the console.

@valeriomonti
Copy link

Same for me

@maverik23
Copy link

Same using

DatePicker::make('date')->native(false),

@FortuneV13
Copy link
Contributor

same issue

@nathanmay
Copy link

Downgrading to 3.2.129 fixes this for me.

@FortuneV13
Copy link
Contributor

Downgrading to 3.2.129 fixes this for me.

I've just done the same

@danharrin
Copy link
Member

I have spent hours trying to fix this, so I am reverting #15062. Livewire will stay locked until a solution is found. I do not have any more time to dedicate to this. Sorry.

@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Dec 17, 2024
@diegobas
Copy link

diegobas commented Dec 17, 2024

These aren't the best solution, but both of them work:

  1. Option 1

    Change date-time-picker.blade.php, lines 192-201:

    <template
        x-init="setupDaysGrid()"
        x-for="day in daysInFocusedMonth"
        x-bind:key="day"
    >
  2. Option 2

    Change date-time-picker.blade.php, lines 192-201:

    <template
        x-for="day in focusedDate.daysInMonth()"
        x-bind:key="day"
    >

@danharrin
Copy link
Member

Thanks, while that does allow the dates to show in the grid I suspect there are other issues in play, also on other form components. We will need to work those out before unlocking.

@dharen008
Copy link
Author

Thank you @danharrin for your effort. I’m confident you’ll solve this in the future; we just need to wait for additional resources.

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

No branches or pull requests

13 participants