So I took the plunge and update one my smallest Phoenix app from 1.7 to 1.8. Took a bit of work (about a day) but I got it up and running. However two issues remain.
-
Every time a LiveView session mounts the whole screen goes gray. I have to click on it and then it goes away. Seems to work fine, until of course I switch the live action and it mounts again.
-
The main reason I jumped to 1.8 so early is to make use of Daisy UI. I have a select drop-down I want to make look like a button. So I thought I could add
class="btn"
(more or less) and I would be good to go. Bu it doesn’t work. All my buttons have become peach color and orange text with the upgrade to 1.8, but my select remains black (maybe b/c the background it sits on is basically black), but I just want it to mach the regular buttons.
Anyone have any ideas?
[Follow Up] I traced the gray screen back to a modal which is, of course, supposed to be hidden (until an event shows it) but the modal’s background and just the background* is coming up regardless. Here the code that was generated:
<div id="help_modal" class="relative z-50" aria-labelledby="modal-title" role="dialog" aria-modal="true" phx-remove="[["hide",{"to":"#help_modal-content","transition":[["ease-in","duration-200"],["opacity-100","scale-100"],["opacity-0","scale-95"]]}],["hide",{"to":"#help_modal","transition":[["ease-in","duration-200"],["opacity-100"],["opacity-0"]]}]]">
<div id="help_modal-bg" class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" phx-click="[["hide",{"to":"#help_modal-content","transition":[["ease-in","duration-200"],["opacity-100","scale-100"],["opacity-0","scale-95"]]}],["hide",{"to":"#help_modal","transition":[["ease-in","duration-200"],["opacity-100"],["opacity-0"]]}]]"></div>
<div class="fixed inset-0 z-50 overflow-y-auto">
<div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
<div id="help_modal-content" class="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all
sm:my-8 sm:w-full sm:max-w-lg sm:p-6
opacity-0 scale-95" phx-click-away="[["hide",{"to":"#help_modal-content","transition":[["ease-in","duration-200"],["opacity-100","scale-100"],["opacity-0","scale-95"]]}],["hide",{"to":"#help_modal","transition":[["ease-in","duration-200"],["opacity-100"],["opacity-0"]]}]]" phx-window-keydown="[["hide",{"to":"#help_modal-content","transition":[["ease-in","duration-200"],["opacity-100","scale-100"],["opacity-0","scale-95"]]}],["hide",{"to":"#help_modal","transition":[["ease-in","duration-200"],["opacity-100"],["opacity-0"]]}]]" phx-key="escape">
That reminds me, modals were something I had trouble with in making the conversion. I remember the compiler saying <.modal>
was not defined. Don’t recall how I resolved that though. I’m sure that is key to the problem. Have to dig deeper…