Skip to content

Commit 940fff6

Browse files
committed
Fix tooltip position for elements on the right side of the screen [publish]
1 parent bf4771e commit 940fff6

File tree

6 files changed

+21
-5
lines changed

6 files changed

+21
-5
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
if: ${{ contains(github.event.head_commit.message, '[publish]') }}
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: xhyrom/[email protected]
13-
- run: rm -rf ~/.bun/install/cache
11+
- uses: actions/checkout@v3
12+
- uses: xhyrom/[email protected]
13+
with:
14+
bun-version: "0.2.1"
1415
- run: bun install
1516
- run: bun ci
1617
- uses: ArnaudBarre/[email protected]

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.0.1
4+
5+
Fix tooltip position for elements on the right side of the screen
6+
37
## 1.0.0
48

59
Initial release

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-react-click-to-component",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"license": "MIT",
55
"scripts": {
66
"dev": "scripts/bundle.ts --dev",

playground/src/App.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,12 @@
3939
.read-the-docs {
4040
color: #888;
4141
}
42+
43+
.full-height {
44+
position: fixed;
45+
top: 20px;
46+
bottom: 20px;
47+
left: 40px;
48+
display: flex;
49+
align-items: center;
50+
}

playground/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export const App = () => {
77

88
return (
99
<div className="App">
10+
<div style={{ position: "fixed", right: 40, top: 40 }}>Top right</div>
11+
<div className="full-height">Full height</div>
1012
<div>
1113
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
1214
<img src="/vite.svg" className="logo" alt="Vite logo" />

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ window.addEventListener("mousemove", (event) => {
7272
tooltipElement.style.left = `${rect.left}px`;
7373
tooltipElement.style.right = "";
7474
} else {
75-
tooltipElement.style.right = `${rect.right}px`;
75+
tooltipElement.style.right = `${window.innerWidth - rect.right}px`;
7676
tooltipElement.style.left = "";
7777
}
7878
if (!hasTooltip) {

0 commit comments

Comments
 (0)