mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 13:21:37 +01:00
Message Context Menu: Fix width jumps, fix not copying text (#1747)
This commit is contained in:
parent
01002f8eb3
commit
4c33acddf0
@ -28,11 +28,15 @@
|
|||||||
touch-action: none;
|
touch-action: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--seen-by {
|
||||||
|
min-width: 14rem;
|
||||||
|
}
|
||||||
|
|
||||||
.avatars {
|
.avatars {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
margin-left: auto;
|
margin-inline-start: auto;
|
||||||
padding-left: 1rem;
|
padding-inline-start: 1rem;
|
||||||
|
|
||||||
.Avatar {
|
.Avatar {
|
||||||
border: 0.0625rem solid var(--color-background);
|
border: 0.0625rem solid var(--color-background);
|
||||||
|
@ -249,6 +249,7 @@ const MessageContextMenu: FC<OwnProps> = ({
|
|||||||
{canReport && <MenuItem icon="flag" onClick={onReport}>{lang('lng_context_report_msg')}</MenuItem>}
|
{canReport && <MenuItem icon="flag" onClick={onReport}>{lang('lng_context_report_msg')}</MenuItem>}
|
||||||
{(canShowSeenBy || canShowReactionsCount) && (
|
{(canShowSeenBy || canShowReactionsCount) && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
className="MessageContextMenu--seen-by"
|
||||||
icon={canShowReactionsCount ? 'reactions' : 'group'}
|
icon={canShowReactionsCount ? 'reactions' : 'group'}
|
||||||
onClick={canShowReactionsCount ? onShowReactors : onShowSeenBy}
|
onClick={canShowReactionsCount ? onShowReactors : onShowSeenBy}
|
||||||
disabled={!canShowReactionsCount && !message.seenByUserIds?.length}
|
disabled={!canShowReactionsCount && !message.seenByUserIds?.length}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
const ELEMENT_NODE = 1;
|
const ELEMENT_NODE = 1;
|
||||||
|
|
||||||
export default function getMessageIdsForSelectedText() {
|
export default function getMessageIdsForSelectedText() {
|
||||||
let selectedFragments = window.getSelection()?.getRangeAt(0).cloneContents();
|
const selection = window.getSelection();
|
||||||
|
let selectedFragments = selection && selection.rangeCount ? selection.getRangeAt(0).cloneContents() : undefined;
|
||||||
if (!selectedFragments || selectedFragments.childElementCount === 0) {
|
if (!selectedFragments || selectedFragments.childElementCount === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user