palantir/blueprint

Merging props when using Popover2 renderTarget

Open

#5,079 建立於 2021年12月21日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
Domain: APIP2Package: popover2help wanted

描述

Environment

  • Package version(s): @blueprintjs/core": "^3.52.0, @blueprintjs/popover2": "^0.12.9
  • Browser and OS versions: Version 96.0.4664.110 (Official Build) snap (64-bit)

Feature request

When using the renderTarget feature of Popover2 (specifically, I'm using Tooltip2), it is not clear which properties are actually used. For example, it seems that if you use {...tooltipProps} and then {className="my-class"}, the latter will overwrite the former and the bp2-popover2-target class will be lost.

Examples

        <Tooltip2
            content="my tooltip"
            renderTarget={({
                ref: tooltipRef,
                isOpen: _tooltipIsOpen,
                ...tooltipProps
            }) => (
                <Button
                    elementRef={tooltipRef as IRef<HTMLButtonElement>}
                    {...tooltipProps}
                    className="my-class" // !!! this overwrites property from ...tooltipProps !!!
                </Button>
            )}
        />

貢獻者指南