v0.12.45 update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rosterchirp-backend",
|
"name": "rosterchirp-backend",
|
||||||
"version": "0.12.44",
|
"version": "0.12.45",
|
||||||
"description": "RosterChirp backend server",
|
"description": "RosterChirp backend server",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
2
build.sh
2
build.sh
@@ -13,7 +13,7 @@
|
|||||||
# ─────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
VERSION="${1:-0.12.44}"
|
VERSION="${1:-0.12.45}"
|
||||||
ACTION="${2:-}"
|
ACTION="${2:-}"
|
||||||
REGISTRY="${REGISTRY:-}"
|
REGISTRY="${REGISTRY:-}"
|
||||||
IMAGE_NAME="rosterchirp-dev"
|
IMAGE_NAME="rosterchirp-dev"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rosterchirp-frontend",
|
"name": "rosterchirp-frontend",
|
||||||
"version": "0.12.44",
|
"version": "0.12.45",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ function TimeInputMobile({ value, onChange }) {
|
|||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [inputVal, setInputVal] = useState(fmt12(value));
|
const [inputVal, setInputVal] = useState(fmt12(value));
|
||||||
const [keyboardOffset, setKeyboardOffset] = useState(0);
|
const [keyboardOffset, setKeyboardOffset] = useState(0);
|
||||||
|
const [dropdownPosition, setDropdownPosition] = useState({ top: 'auto', bottom: 'auto' });
|
||||||
const wrapRef = useRef(null);
|
const wrapRef = useRef(null);
|
||||||
const listRef = useRef(null);
|
const listRef = useRef(null);
|
||||||
|
|
||||||
@@ -98,6 +99,27 @@ function TimeInputMobile({ value, onChange }) {
|
|||||||
}
|
}
|
||||||
}, [open]);
|
}, [open]);
|
||||||
|
|
||||||
|
// Calculate dropdown position based on available space
|
||||||
|
useEffect(() => {
|
||||||
|
if (open && wrapRef.current) {
|
||||||
|
const rect = wrapRef.current.getBoundingClientRect();
|
||||||
|
const dropdownHeight = 200; // Approximate height of 5 time slots
|
||||||
|
const spaceAbove = rect.top;
|
||||||
|
const spaceBelow = window.innerHeight - rect.bottom - keyboardOffset;
|
||||||
|
|
||||||
|
if (spaceBelow >= dropdownHeight) {
|
||||||
|
// Show below if enough space
|
||||||
|
setDropdownPosition({ top: '100%', bottom: 'auto' });
|
||||||
|
} else if (spaceAbove >= dropdownHeight) {
|
||||||
|
// Show above if more space above
|
||||||
|
setDropdownPosition({ top: 'auto', bottom: '100%' });
|
||||||
|
} else {
|
||||||
|
// Show above anyway (better than being hidden)
|
||||||
|
setDropdownPosition({ top: 'auto', bottom: '100%' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [open, keyboardOffset]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!open || !listRef.current) return;
|
if (!open || !listRef.current) return;
|
||||||
const idx = TIME_SLOTS.findIndex(s => s.value === value);
|
const idx = TIME_SLOTS.findIndex(s => s.value === value);
|
||||||
@@ -145,8 +167,8 @@ function TimeInputMobile({ value, onChange }) {
|
|||||||
width: 130,
|
width: 130,
|
||||||
maxHeight: 5 * 40,
|
maxHeight: 5 * 40,
|
||||||
overflowY: 'auto',
|
overflowY: 'auto',
|
||||||
bottom: keyboardOffset > 0 ? keyboardOffset + 10 : 'auto',
|
...dropdownPosition,
|
||||||
top: keyboardOffset > 0 ? 'auto' : '100%',
|
left: wrapRef.current ? wrapRef.current.getBoundingClientRect().left : 'auto',
|
||||||
pointerEvents: 'auto',
|
pointerEvents: 'auto',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user