Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(popconfirm): add additional null checks for getComputedStyle calls
Co-authored-by: liweijie0812 <10710889+liweijie0812@users.noreply.github.com>
  • Loading branch information
Copilot and liweijie0812 committed Nov 30, 2025
commit e78a21224403eece02430479e5e083eb26f4e468
7 changes: 6 additions & 1 deletion packages/shared/hooks/useRipple/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export function useRipple(el: Ref<HTMLElement>, fixedRippleColor?: Ref<string>)
)
return;

// Check again if element is still valid before calling getComputedStyle
if (!(dom instanceof Element)) return;
const elStyle = getComputedStyle(dom);

const elBorder = parseInt(elStyle.borderWidth, 10);
Expand Down Expand Up @@ -109,7 +111,10 @@ export function useRipple(el: Ref<HTMLElement>, fixedRippleColor?: Ref<string>)
}

// fix position
const initPosition = dom.style.position ? dom.style.position : getComputedStyle(dom).position;
let initPosition = dom.style.position;
if (!initPosition && dom instanceof Element) {
initPosition = getComputedStyle(dom).position;
}
if (initPosition === '' || initPosition === 'static') {
// eslint-disable-next-line no-param-reassign
dom.style.position = 'relative';
Expand Down
Loading