You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing because I'm encountering a problem that's starting to drive me crazy, In my livewire controller, $this->closeModal(); doesn't really close the modal, it just makes it visually disappear but it's still there, on top of the page, because I can't click on anything and I can see the modal scrolling bars are still there on top of the ones from the page.
I scrolled in every direction, the modal didn't go anywhere else on the screen, it's as if there was a display:none; but the component itself wasn't deleted.
Before pressing the button that closes this modal, if I press Esc or click outside, it's closed properly, but after clicking the button I'm stucked, I have to refresh the page to be able to select elements on it again.
I don't understand what I'm doing wrong, I tried $this->forceClose()->closeModal(); and $this->closeModal(true);, $this->closeModal(false);, same result.
There is no error in logs, nothing in the javascript console.
protected $listeners = ['ResourceTypeSelected' => 'selectResourceType'];
public function selectResourceType() {
$this->dispatchBrowserEvent('test', []);
$this->closeModal(false);
}
The $this->dispatchBrowserEvent('test', []); works well and triggers without problem the javascript listener on the page.
Can anyone help me ? I would really appreciate it because I'm stuck ^^
EDIT :
By simulating an Esc key press in javascript after running my selectResourceType() controller function, I noticed that the same problem happened, only when I press Esc myself the modal closes correctly. So I'm guessing the controller function somehow messes with closeModal, but why and how I have no idea.
I'm using mcamara/laravel-localization to translate routes, could that be the problem ? Because that happened with Livewire when I installed it and I had to add this to the middleware_group in config/livewire.php :
This discussion was converted from issue #167 on February 11, 2022 19:55.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
First of all, thanks for your work :)
I'm writing because I'm encountering a problem that's starting to drive me crazy, In my livewire controller, $this->closeModal(); doesn't really close the modal, it just makes it visually disappear but it's still there, on top of the page, because I can't click on anything and I can see the modal scrolling bars are still there on top of the ones from the page.
I scrolled in every direction, the modal didn't go anywhere else on the screen, it's as if there was a display:none; but the component itself wasn't deleted.
Before pressing the button that closes this modal, if I press Esc or click outside, it's closed properly, but after clicking the button I'm stucked, I have to refresh the page to be able to select elements on it again.
I don't understand what I'm doing wrong, I tried $this->forceClose()->closeModal(); and $this->closeModal(true);, $this->closeModal(false);, same result.
There is no error in logs, nothing in the javascript console.
Here's my view :
And in my controller :
The $this->dispatchBrowserEvent('test', []); works well and triggers without problem the javascript listener on the page.
Can anyone help me ? I would really appreciate it because I'm stuck ^^
EDIT :
By simulating an Esc key press in javascript after running my selectResourceType() controller function, I noticed that the same problem happened, only when I press Esc myself the modal closes correctly. So I'm guessing the controller function somehow messes with closeModal, but why and how I have no idea.
I'm using mcamara/laravel-localization to translate routes, could that be the problem ? Because that happened with Livewire when I installed it and I had to add this to the middleware_group in config/livewire.php :
Beta Was this translation helpful? Give feedback.
All reactions