@@ -373,12 +373,6 @@ export class Popover<
373373 // Ensure target is focusable if relevant prop enabled
374374 const targetTabIndex = openOnTargetFocus && isHoverInteractionKind ? 0 : undefined ;
375375 const ownTargetProps = {
376- "aria-expanded" : isOpen ,
377- "aria-haspopup" :
378- this . props . popupKind ??
379- ( this . props . interactionKind === PopoverInteractionKind . HOVER_TARGET_ONLY
380- ? undefined
381- : ( "true" as const ) ) ,
382376 // N.B. this.props.className is passed along to renderTarget even though the user would have access to it.
383377 // If, instead, renderTarget is undefined and the target is provided as a child, this.props.className is
384378 // applied to the generated target wrapper element.
@@ -390,6 +384,12 @@ export class Popover<
390384 ref,
391385 ...targetEventHandlers ,
392386 } satisfies React . HTMLProps < HTMLElement > ;
387+ const childTargetProps = {
388+ "aria-expanded" : isOpen ,
389+ "aria-haspopup" :
390+ this . props . popupKind ??
391+ ( this . props . interactionKind === PopoverInteractionKind . HOVER_TARGET_ONLY ? undefined : true ) ,
392+ } satisfies React . HTMLProps < HTMLElement > ;
393393
394394 const targetModifierClasses = {
395395 // this class is mainly useful for Blueprint <Button> targets; we should only apply it for
@@ -404,6 +404,7 @@ export class Popover<
404404 if ( renderTarget !== undefined ) {
405405 target = renderTarget ( {
406406 ...ownTargetProps ,
407+ ...childTargetProps ,
407408 className : classNames ( ownTargetProps . className , targetModifierClasses ) ,
408409 // if the consumer renders a tooltip target, it's their responsibility to disable that tooltip
409410 // when *this* popover is open
@@ -418,6 +419,7 @@ export class Popover<
418419 }
419420
420421 const clonedTarget : JSX . Element = React . cloneElement ( childTarget , {
422+ ...childTargetProps ,
421423 className : classNames ( childTarget . props . className , targetModifierClasses ) ,
422424 // force disable single Tooltip child when popover is open
423425 disabled : isOpen && Utils . isElementOfType ( childTarget , Tooltip ) ? true : childTarget . props . disabled ,
0 commit comments