mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(web): allow copying text in photo viewer (#9705)
* fix(web): allow copying text in photo viewer * use default browser copy * revert changes * fix lint
This commit is contained in:
parent
69b5eb005f
commit
b3b258f32f
@ -120,10 +120,11 @@
|
|||||||
forceLoadOriginal = state.currentZoom > 1 && isWebCompatibleImage(asset) ? true : false;
|
forceLoadOriginal = state.currentZoom > 1 && isWebCompatibleImage(asset) ? true : false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const onCopyShortcut = () => {
|
const onCopyShortcut = (event: KeyboardEvent) => {
|
||||||
if (window.getSelection()?.type === 'Range') {
|
if (window.getSelection()?.type === 'Range') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
event.preventDefault();
|
||||||
handlePromiseError(doCopy());
|
handlePromiseError(doCopy());
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -132,8 +133,8 @@
|
|||||||
on:copyImage={doCopy}
|
on:copyImage={doCopy}
|
||||||
on:zoomImage={doZoomImage}
|
on:zoomImage={doZoomImage}
|
||||||
use:shortcuts={[
|
use:shortcuts={[
|
||||||
{ shortcut: { key: 'c', ctrl: true }, onShortcut: onCopyShortcut },
|
{ shortcut: { key: 'c', ctrl: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
||||||
{ shortcut: { key: 'c', meta: true }, onShortcut: onCopyShortcut },
|
{ shortcut: { key: 'c', meta: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
{#if imageError}
|
{#if imageError}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user