Skip to content

Commit 10653b9

Browse files
committed
now title can last at least 8 secs after long press
1 parent 5cdab91 commit 10653b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/components/button.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ function Button(props) {
3939

4040
const handleMouseUp = () => {
4141
clearTimeout(timeRef.current);
42-
setIsPortalOpen(false);
42+
setTimeout(() => setIsPortalOpen(false), displayTime);
4343
}
4444

4545
useEffect(() => {
4646
if (isPortalOpen) {
47-
const displayTime = Math.min(8, 0.1 * title.length) * 1000;
47+
const displayTime = Math.max(8, 0.1 * title.length) * 1000;
4848
const timeout = setTimeout(() => {
4949
setIsPortalOpen(false);
5050
}, displayTime);

0 commit comments

Comments
 (0)