wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 166 forks source link

Erro flatpicker #412

Closed galegobr01 closed 1 year ago

galegobr01 commented 1 year ago

Adicionei 2 DateTime-Picker e um botão, esse botão chama o Powergrid com alguns parametros. Quando clico no botão ele dá um erro do flatpicker

image

Seria alguma configuração por usar dois DateTimer-Picker?

joaopalopes24 commented 1 year ago

Try showing some code

galegobr01 commented 1 year ago

Blade que chama o componente livewire com o campos para a busca

image

Aqui o formulário do componente livewire acima

image image

Aqui como fica ele renderizado

Antes de clicar em Relatório image

Validação funcionando image

Ao clicar em relatório informando as datas ai ocorre o erro image

PH7-Jack commented 1 year ago

@galegobr01 Thanks for reporting.

I believe this bug is referent to the PowerGrid table component, and not to wireui select, the wireui select doesn't use the flatpickr. Try to use a static wire:key instead of using a random id, maybe the livewire is broken when the conditional element is showing because the wire:key is randomly

Question: The table component works when you're not using the wireui components on the same page?

Tip: You're using a blade/livewire component in your blade page, so you can pass the attributes using :user="$user", it will pass the $user variable without encoding it and giving it as a parameter. Use the {{ $variable }} only to render data, to give parameters to a blade/livewire component just prefix the parameter name with ":" (colon).

galegobr01 commented 1 year ago

Opa Pedrão

Question: The table component works when you're not using the wireui components on the same page? Sim funcionam sim.

Fiz a alteração proposta e realmente o erro do flatpicker sumiu.

image Selecionando a Data Inicial

image Selecionando a Data Final

image Selecionei a Data Final, mas o datetime-picker não fechou (Não sei se é esse realmente o comportamento dele).

image Cliquei em relatorio, ai fechou o datetime-picker e abriu normal o PowerGrid

Caso eu tente mudar a Data Inicial ou Final o datetime-picker aparece da seguinte forma ( o primeiro que eu clicar) image

O segundo já abre normalmente image

Mas se eu mudar a data (Mudei de 31 para 30) ocorre o mesmo image

Grato pela atenção e respostas.

galegobr01 commented 1 year ago

Para desencargo da consciencia e tira teima rsrrsrsr, adicionei um wire:key nos dois datetime-picker e o problema aparentemente foi sanado, não apresentando o comportamento do comentário acima logo na segunda mudança, mas após algumas tentativas o problema do datetime-picker ocorreu novamente.

image

ao clicar pra o proximo mes ou anterior aparece assim image

Ai se eu selecionar uma data nessa imagem acima monta o datetime-picker novamente

Novamente grato pela atenção

PH7-Jack commented 1 year ago

@galegobr01 Maybe if you wrap the power grid component into a div with wire:key it will work. I believe this problem will be solved with wire:key. If it still persists we can schedule a meet to look it

PS: the datepicker component doesn't uses the debounce in the wire:model, only the defer modifier is supported.

joaopalopes24 commented 1 year ago

@galegobr01 Does the error persist?

joaopalopes24 commented 1 year ago

Old issue, closing it now. Feel free to tag me to reopen.