TrestleAdmin / trestle

A modern, responsive admin framework for Ruby on Rails
https://trestle.io
GNU Lesser General Public License v3.0
1.96k stars 177 forks source link

[Datetime Field / Safari] Screen freeze on datetime field manipulation with Popup behavior on Safari #463

Closed GabGab closed 2 months ago

GabGab commented 3 months ago

Hello everyone,

I'm on a Rails 6 project, with Trestle 0.8.13 and Trestle-search 0.3.0. I'm testing with Safari 17.5, and Chrome 125.0.6422.142

I have a Task model and am using Trestle to let an admin create/update tasks. In the form, which has the dialog: true option, i have simple datetime_field fields.

On Chrome, everything works perfectly fine. On Safari however, when i click on the field, a calendar opens nicely. But once i interact once with it (for example by selecting a date), the interaction goes through (the date is selected) but then the whole browser freezes and i can't do anything.

I have noticed this behavior only with the dialog: true option activated on the form, i have other datetime fields in other forms (which are not displayed in a dialog), and there is no freeze on Safari.

This is a screen after the freeze happens :

Capture d’écran 2024-06-18 à 11 11 45

A javascript error happens in the console :

Capture d’écran 2024-06-18 à 11 12 00

To reproduce, simply use a standard Trestle admin model and code a form like this :

form dialog: true do |task|
      row do
        col(xs: 6) {
          datetime_field :datetime_column1
        }
        col(xs: 6) {
          datetime_field :datetime_column2
        }
      end
end

Are you able to reproduce this behavior ? If so, do you know what could cause this specific problem ?

Thank you for your help!

spohlenz commented 3 months ago

I am able to reproduce this with Trestle 0.8.13 (on Chrome as well). However this is a particularly old release.

Trestle 0.9.x does not exhibit this behavior. Are you able to upgrade to version 0.9.9?

GabGab commented 3 months ago

I am able to reproduce this with Trestle 0.8.13 (on Chrome as well). However this is a particularly old release.

Trestle 0.9.x does not exhibit this behavior. Are you able to upgrade to version 0.9.9?

Hello ! Thank you for your quick reply, and sorry for my late one. We have finally decided to go forward with the update to Trestle 0.9.9, hoping not to encounter too many breaking changes along the way ... :).

Will update you if that fixes our problem!

GabGab commented 2 months ago

Hi again @spohlenz !

The update to 0.9.9 indeed fixed the Safari freeze on datetime field change, thank you for that ! I'm having another issue after the update but as it is a different topic, i will create a new Issue for it :)

I don't know what's the best practice, should i close this issue myself or do you ?

Thanks again for your timely help

spohlenz commented 2 months ago

Glad to hear it's resolved.