Skip to content

Commit 6584f8e

Browse files
committed
feat: enhance usePopover to support attribute selector for responsive styles
1 parent 1f2ae6c commit 6584f8e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/headless/src/popover/usePopover.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { defaultProps } from './usePopover.props';
1212
export const usePopover = withHeadless({
1313
name: 'usePopover',
1414
defaultProps,
15-
setup: ({ props }) => {
15+
setup: ({ props, $attrSelector }) => {
1616
const { dismissable, baseZIndex = 0, autoZIndex, closeOnEscape, defaultOpen, open, onOpenChange, breakpoints } = props;
1717
const [visibleState, setVisibleState] = React.useState(false);
1818
const selfClick = React.useRef(false);
@@ -264,7 +264,7 @@ export const usePopover = withHeadless({
264264
for (const breakpoint in breakpoints) {
265265
innerHTML += `
266266
@media screen and (max-width: ${breakpoint}) {
267-
.p-popover {
267+
.p-popover[${$attrSelector}] {
268268
width: ${breakpoints[breakpoint]} !important;
269269
}
270270
}

0 commit comments

Comments
 (0)