mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
Refactor event path handling to use getComposedPath utility
- Replaced direct usage of event.composedPath() with a new utility function getComposedPath in Control component. - Updated includeFromEvent function to utilize getComposedPath for better compatibility. - Implemented getComposedPath function to ensure consistent event path retrieval across different browsers.
This commit is contained in:
1 parent
412b8e7fa7
commit
05ce97c6fd
12 files changed
+41
-14
No files matched your search
@@ -20,6 +20,7 @@ import {
|
||||
inverseClass,
|
||||
createElement,
|
||||
includeFromEvent,
|
||||
getComposedPath,
|
||||
} from '../utils';
|
||||
|
||||
export default class Control extends Component {
|
||||
@@ -265,7 +266,7 @@ export default class Control extends Component {
|
||||
}
|
||||
|
||||
const event = proxy($list, 'click', async (event) => {
|
||||
const path = event.composedPath() || [];
|
||||
const path = getComposedPath(event);
|
||||
const item = option.selector.find(
|
||||
(item) => item.$control_item === path.find(($item) => item.$control_item === $item),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user