Search code examples
javascriptgoogle-chromesafarievent-handlingonblur

Blur event for composedPath returns empty array on window for Safari


I am trying to apply composedPath to the blur event. I have noticed however, that Safari returns an empty array for composedPath.

On Chrome I do get the array of size one with the window object.

Here is my jsFiddle:

JSFiddle Link

I tried looking for blur event on mdn if it is unsupported on Safari but that is not the case. Version of Safari is 15.

 window.addEventListener('blur', (e)=>{
                debugger;
                console.log("Composed Path" , e.composedPath());
            });
    <head>
        <title>Example</title>
    </head>
    <body>
        <p>This is an example of a simple HTML page with one paragraph.</p>
    </body>


Solution

  • It seems like bug so I have raised it on WebKit bugzilla - https://bugs.webkit.org/show_bug.cgi?id=253443 and now it is fixed.

    Committed - https://github.com/WebKit/WebKit/commit/80b26f0e3d9ab9f091390232abbdfae07ff82476