fix(editor): Improve touch device detection (#9675)
This commit is contained in:
committed by
GitHub
parent
dc17cf3a49
commit
3b86f52b02
@@ -44,3 +44,18 @@ export class IntersectionObserver {
|
||||
|
||||
window.IntersectionObserver = IntersectionObserver;
|
||||
global.IntersectionObserver = IntersectionObserver;
|
||||
|
||||
// Mocks for useDeviceSupport
|
||||
Object.defineProperty(window, 'matchMedia', {
|
||||
writable: true,
|
||||
value: vi.fn().mockImplementation((query) => ({
|
||||
matches: true,
|
||||
media: query,
|
||||
onchange: null,
|
||||
addListener: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
addEventListener: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
dispatchEvent: vi.fn(),
|
||||
})),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user