enable selecting message text on desktop (#315)

This commit is contained in:
Bullish Bear 2023-11-21 11:39:04 +08:00 committed by GitHub
parent bed584cb40
commit b704949525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -326,7 +326,9 @@ function MessageBoxGroup(props: {
const rows = [];
rows.push(
<li
class={tw`px-4 hover:bg-[#32353B] w-full max-w-full flex items-start pr-8 mobile:pr-4 group relative mobile:select-none`}
class={tw`px-4 hover:bg-[#32353B] w-full max-w-full flex items-start pr-8 mobile:pr-4 group relative ${
mobileCheck() ? "select-none" : ""
}`}
>
{MessageActions(first_group, props.emit)}
<Avatar
@ -372,7 +374,9 @@ function MessageBoxGroup(props: {
const msg = messageGroups[i];
rows.push(
<li
class={tw`px-4 hover:bg-[#32353B] w-full max-w-full flex items-center pr-8 group relative text-sm mobile:select-none`}
class={tw`px-4 hover:bg-[#32353B] w-full max-w-full flex items-center pr-8 group relative text-sm ${
mobileCheck() ? "select-none" : ""
}`}
>
{MessageActions(msg, props.emit)}
{Time(msg.created_at)}
@ -638,3 +642,7 @@ class JitterPrevention {
return !cancelled;
}
}
function mobileCheck() {
return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
}