livewire / flux

The official Livewire UI component library
https://fluxui.dev
476 stars 42 forks source link

Console warnings (Firefox browser) #310

Closed 0hra closed 1 month ago

0hra commented 1 month ago

I am re-submitting this issue with more information as requested (Issue #88) I have a fresh bare bones installation of Laravel with Livewire + TailwindCSS + Flux (All installed exactly as described in their respective docs).

This is the laravel welcome.blade.php file:

<!DOCTYPE html>
<html>
    <head>
        <title>Laravel</title>
        @vite(['resources/css/app.css', 'resources/js/app.js'])
        @fluxStyles
    </head>
    <body>
        @fluxScripts
    </body>
</html>

I am running the latest Firefox version, 131.0 (aarch64) on MacOS.

When I inspect the page in Firefox and open the "Console" tab and refresh the page, these warnings are displayed: Image

The first warning refers to this:

closest(el, condition) {
      return;
      let walker2 = this.from(el).walker;
      while (walker2.currentNode) {
        if (condition(walker2.currentNode)) return walker2.currentNode;
        walker2.parentNode();
      }
    }

And the second warning refers to this:

function mouseIsExclusivelyInsideSafeArea(triggerRect, panelRect, x, y) {
    return !mouseIsOverTrigger(triggerRect, x, y) && !mouseIsOverPanel(panelRect, x, y);
    return true;
  }
benjibee commented 1 month ago

@calebporzio The issue here is that the methods have logic after the return statement. It just happens to be that only Firefox shows a console warning for this.

// js/utils.js:71

closest(el, condition) {
    return; // <-- will always return true!
    let walker2 = this.from(el).walker;
    while (walker2.currentNode) {
        if (condition(walker2.currentNode)) return walker2.currentNode;
        walker2.parentNode();
    }
}
calebporzio commented 1 month ago

Good catch, thank you for making this easy.