amsul / amsul/pickadate.js

`getRealEventTarget` should use `Event.composedPath()` instead of `Event.path`

未關閉
#1,239 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
7.6k
分支
981
PR 合併指標
30 天內沒有已合併 PR

描述

https://github.com/amsul/pickadate.js/blob/0fd34eab2b4127bc93dedca70285f1d38eb89983/lib/picker.js#L996-L1017

`getRealEventTarget()` uses `Event.path`, which is a non-standard API available only in Chromium-based browsers.

It should instead use `Event.composedPath()` [1], which is a standard API that returns the same result but is supported by all major browsers [2].

Chromium is also deprecating `Event.path` in favor of `Event.composedPath()`.

See:
[1] https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
[2] https://caniuse.com/?search=Event.composedPath
[3] https://bugs.chromium.org/p/chromium/issues/detail?id=1277431

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。