Skip to content

Commit 3346e9f

Browse files
authored
Merge pull request #1263 from ReactTooltip/copilot/fix-border-overlap-issue
Fix arrow shoulder corners bleeding outside tooltip border
2 parents f18cb72 + 91f3967 commit 3346e9f

9 files changed

Lines changed: 70 additions & 402 deletions

File tree

.github/workflows/beta-release.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
name: Beta Release
22

33
on:
4-
workflow_call:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
56

67
jobs:
78
beta_release:
9+
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false
810
runs-on: ubuntu-latest
11+
concurrency:
12+
group: beta-release-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
914
permissions:
1015
contents: read
1116
id-token: write
17+
issues: write
18+
pull-requests: write
1219
steps:
1320
- uses: actions/checkout@v4
1421
with:
1522
ref: ${{ github.head_ref }}
1623
- uses: actions/setup-node@v4
1724
with:
18-
node-version: '20.x'
25+
node-version: '24.14.0'
1926
registry-url: 'https://registry.npmjs.org'
2027
cache: 'yarn'
2128

@@ -36,7 +43,14 @@ jobs:
3643
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
3744

3845
- name: Release a new beta version
39-
run: npm publish --tag beta --provenance --access public
46+
run: npm publish --tag beta --access public
47+
48+
- name: Upload npm debug logs
49+
if: failure()
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: npm-debug-logs
53+
path: /home/runner/.npm/_logs
4054

4155
- uses: actions/github-script@v6
4256
with:

.github/workflows/bundlesize.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/pull-request.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ jobs:
1212
if: 'github.event.pull_request.draft == false'
1313
uses: ./.github/workflows/lint.yaml
1414

15-
bundlesize:
16-
if: 'github.event.pull_request.draft == false'
17-
uses: ./.github/workflows/bundlesize.yaml
18-
19-
beta_release:
20-
uses: ./.github/workflows/beta-release.yaml
21-
# allow the children job to have access to the secrets of the repository
22-
secrets: inherit
23-
2415
fail_if_pull_request_is_draft:
2516
if: github.event.pull_request.draft == true
2617
runs-on: ubuntu-18.04

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212
"stylelint": "stylelint \"src/**/*.css\"",
1313
"prettier": "prettier --config ./.prettierrc.json --write \"src/**/*{.js,.jsx,.ts,.tsx,.css}\"",
1414
"prepare": "husky install",
15-
"bundlesize": "bundlesize",
1615
"esbuild": "esbuild",
1716
"test": "jest",
18-
"postbuild": "npm run types && npm run bundlesize",
1917
"prepublishOnly": "npm run build"
2018
},
2119
"types": "dist/react-tooltip.d.ts",
2220
"license": "MIT",
2321
"private": false,
2422
"author": "ReactTooltip",
25-
"repository": "https://github.com/ReactTooltip/react-tooltip",
23+
"repository": {
24+
"type": "git",
25+
"url": "https://github.com/ReactTooltip/react-tooltip"
26+
},
2627
"keywords": [
2728
"react",
2829
"react-component",
@@ -64,7 +65,6 @@
6465
"@types/react-test-renderer": "^18.0.0",
6566
"@typescript-eslint/eslint-plugin": "5.54.0",
6667
"@typescript-eslint/parser": "5.54.0",
67-
"bundlesize": "^0.18.1",
6868
"css-loader": "6.7.3",
6969
"esbuild": "0.17.11",
7070
"esbuild-css-modules-plugin": "^2.7.1",

src/components/Tooltip/Tooltip.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,15 @@ const Tooltip = ({
926926
}}
927927
ref={tooltipRef}
928928
>
929-
{actualContent}
929+
<WrapperElement
930+
className={classNames(
931+
'react-tooltip-content-wrapper',
932+
coreStyles['content'],
933+
styles['content'],
934+
)}
935+
>
936+
{actualContent}
937+
</WrapperElement>
930938
<WrapperElement
931939
className={classNames(
932940
'react-tooltip-arrow',

src/components/Tooltip/core-styles.module.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
position: absolute;
1616
background: inherit;
1717
z-index: -1;
18+
-webkit-backface-visibility: hidden;
19+
backface-visibility: hidden;
20+
}
21+
22+
.content {
23+
position: relative;
24+
z-index: 1;
1825
}
1926

2027
.noArrow {

src/components/Tooltip/styles.module.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
.tooltip {
2-
padding: 8px 16px;
32
border-radius: 3px;
43
font-size: 90%;
54
width: max-content;
65
}
76

7+
.content {
8+
background: inherit;
9+
border-radius: inherit;
10+
padding: 8px 16px;
11+
}
12+
813
.arrow {
914
width: var(--rt-arrow-size);
1015
height: var(--rt-arrow-size);

src/utils/compute-tooltip-position.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const computeTooltipPosition = async ({
7979
right: '',
8080
bottom: '',
8181
...borderSide,
82-
[staticSide]: `-${arrowSize / 2 + borderWidth}px`,
82+
[staticSide]: `-${arrowSize / 2 + borderWidth - 1}px`,
8383
}
8484
/* c8 ignore end */
8585

0 commit comments

Comments
 (0)