fix(client): リアクションピッカーの高さが低くなったまま戻らないことがあるのを修正

Fix #8071
This commit is contained in:
syuilo 2022-02-13 16:35:53 +09:00
parent 93cb26e879
commit 9d7352a9e4
2 changed files with 22 additions and 9 deletions

View File

@ -10,6 +10,14 @@
You should also include the user name that made the change.
-->
## 12.x.x (unreleased)
### Improvements
-
### Bugfixes
- Client: リアクションピッカーの高さが低くなったまま戻らないことがあるのを修正 @syuilo
## 12.107.0 (2022/02/12)
### Improvements

View File

@ -102,7 +102,6 @@ const align = () => {
if (type.value === 'drawer') return;
const popover = content.value!;
if (popover == null) return;
const rect = props.src.getBoundingClientRect();
@ -131,11 +130,12 @@ const align = () => {
left = window.innerWidth - width;
}
const underSpace = (window.innerHeight - MARGIN) - top;
const upperSpace = (rect.top - MARGIN);
//
if (top + height > (window.innerHeight - MARGIN)) {
if (props.noOverlap) {
const underSpace = (window.innerHeight - MARGIN) - top;
const upperSpace = (rect.top - MARGIN);
if (underSpace >= (upperSpace / 3)) {
maxHeight.value = underSpace;
} else {
@ -145,6 +145,8 @@ const align = () => {
} else {
top = (window.innerHeight - MARGIN) - height;
}
} else {
maxHeight.value = underSpace;
}
} else {
//
@ -152,11 +154,12 @@ const align = () => {
left = window.innerWidth - width + window.pageXOffset - 1;
}
const underSpace = (window.innerHeight - MARGIN) - (top - window.pageYOffset);
const upperSpace = (rect.top - MARGIN);
//
if (top + height - window.pageYOffset > (window.innerHeight - MARGIN)) {
if (props.noOverlap) {
const underSpace = (window.innerHeight - MARGIN) - (top - window.pageYOffset);
const upperSpace = (rect.top - MARGIN);
if (underSpace >= (upperSpace / 3)) {
maxHeight.value = underSpace;
} else {
@ -166,6 +169,8 @@ const align = () => {
} else {
top = (window.innerHeight - MARGIN) - height + window.pageYOffset - 1;
}
} else {
maxHeight.value = underSpace;
}
}