mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05: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
1 changed files with 4 additions and 3 deletions
|
@ -120,10 +120,11 @@
|
|||
forceLoadOriginal = state.currentZoom > 1 && isWebCompatibleImage(asset) ? true : false;
|
||||
});
|
||||
|
||||
const onCopyShortcut = () => {
|
||||
const onCopyShortcut = (event: KeyboardEvent) => {
|
||||
if (window.getSelection()?.type === 'Range') {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
handlePromiseError(doCopy());
|
||||
};
|
||||
</script>
|
||||
|
@ -132,8 +133,8 @@
|
|||
on:copyImage={doCopy}
|
||||
on:zoomImage={doZoomImage}
|
||||
use:shortcuts={[
|
||||
{ shortcut: { key: 'c', ctrl: true }, onShortcut: onCopyShortcut },
|
||||
{ shortcut: { key: 'c', meta: true }, onShortcut: onCopyShortcut },
|
||||
{ shortcut: { key: 'c', ctrl: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
||||
{ shortcut: { key: 'c', meta: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
||||
]}
|
||||
/>
|
||||
{#if imageError}
|
||||
|
|
Loading…
Reference in a new issue