Merge pull request #160 from PasteBar/fix-quick-paste-window-shortcuts-numbers-is-wrong-when-using-search
Fix quick paste window shortcuts numbers is wrong when using search
This commit is contained in:
commit
44c879b0ed
5
.changeset/grumpy-mangos-do.md
Normal file
5
.changeset/grumpy-mangos-do.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'pastebar-app-ui': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Update to shortcut for quick copy paste ctrl + number added cmd key press on mac
|
@ -54,6 +54,7 @@ interface ClipboardHistoryQuickPasteRowProps {
|
|||||||
index?: number
|
index?: number
|
||||||
style?: CSSProperties
|
style?: CSSProperties
|
||||||
isExpanded: boolean
|
isExpanded: boolean
|
||||||
|
isWindows?: boolean
|
||||||
isWrapText: boolean
|
isWrapText: boolean
|
||||||
isSelected?: boolean
|
isSelected?: boolean
|
||||||
isDeleting?: boolean
|
isDeleting?: boolean
|
||||||
@ -125,6 +126,7 @@ export function ClipboardHistoryQuickPasteRowComponent({
|
|||||||
isScrolling = false,
|
isScrolling = false,
|
||||||
isPinnedTop = false,
|
isPinnedTop = false,
|
||||||
isPinnedTopFirst = false,
|
isPinnedTopFirst = false,
|
||||||
|
isWindows,
|
||||||
isDisabledPinnedMoveUp = false,
|
isDisabledPinnedMoveUp = false,
|
||||||
isDisabledPinnedMoveDown = false,
|
isDisabledPinnedMoveDown = false,
|
||||||
isExpanded = false,
|
isExpanded = false,
|
||||||
@ -306,7 +308,9 @@ export function ClipboardHistoryQuickPasteRowComponent({
|
|||||||
}, [clipboard?.isLink, hasLinkCard])
|
}, [clipboard?.isLink, hasLinkCard])
|
||||||
|
|
||||||
const showCopyPasteIndexNumber =
|
const showCopyPasteIndexNumber =
|
||||||
isKeyCtrlPressed.value && typeof index !== 'undefined' && index < 10
|
(isKeyCtrlPressed.value || (isKeyAltPressed.value && !isWindows)) &&
|
||||||
|
typeof index !== 'undefined' &&
|
||||||
|
index < 10
|
||||||
|
|
||||||
const pinnedTopOffsetFirst = !isPinnedTopFirst ? 'top-[-10px]' : 'top-[5px]'
|
const pinnedTopOffsetFirst = !isPinnedTopFirst ? 'top-[-10px]' : 'top-[5px]'
|
||||||
const bgToolsPanel = `${
|
const bgToolsPanel = `${
|
||||||
|
@ -301,7 +301,9 @@ export function ClipboardHistoryRowComponent({
|
|||||||
}, [clipboard?.isLink, hasLinkCard])
|
}, [clipboard?.isLink, hasLinkCard])
|
||||||
|
|
||||||
const showCopyPasteIndexNumber =
|
const showCopyPasteIndexNumber =
|
||||||
isKeyCtrlPressed.value && typeof index !== 'undefined' && index < 10
|
(isKeyCtrlPressed.value || (isKeyAltPressed.value && !isWindows)) &&
|
||||||
|
typeof index !== 'undefined' &&
|
||||||
|
index < 10
|
||||||
|
|
||||||
const pinnedTopOffsetFirst = !isPinnedTopFirst ? 'top-[-10px]' : 'top-[5px]'
|
const pinnedTopOffsetFirst = !isPinnedTopFirst ? 'top-[-10px]' : 'top-[5px]'
|
||||||
const bgToolsPanel = `${
|
const bgToolsPanel = `${
|
||||||
|
@ -317,6 +317,7 @@ export default function ClipboardHistoryPage() {
|
|||||||
useHotkeys(
|
useHotkeys(
|
||||||
[...Array(10).keys()].map(i => `ctrl+${i.toString()}`),
|
[...Array(10).keys()].map(i => `ctrl+${i.toString()}`),
|
||||||
e => {
|
e => {
|
||||||
|
e.preventDefault()
|
||||||
const index = e.key === '0' ? 9 : Number(e.key) - 1
|
const index = e.key === '0' ? 9 : Number(e.key) - 1
|
||||||
const itemId = clipboardHistory[Number(index)]?.historyId
|
const itemId = clipboardHistory[Number(index)]?.historyId
|
||||||
|
|
||||||
@ -325,12 +326,35 @@ export default function ClipboardHistoryPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setCopiedItem(itemId)
|
setCopiedItem(itemId)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enableOnFormTags: ['input'],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
useHotkeys(
|
||||||
|
[...Array(10).keys()].map(i => `meta+${i.toString()}`),
|
||||||
|
e => {
|
||||||
|
e.preventDefault()
|
||||||
|
const index = e.key === '0' ? 9 : Number(e.key) - 1
|
||||||
|
const itemId = clipboardHistory[Number(index)]?.historyId
|
||||||
|
|
||||||
|
if (!itemId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setCopiedItem(itemId)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enabled: !isWindows,
|
||||||
|
enableOnFormTags: ['input'],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
[...Array(10).keys()].map(i => `ctrl+${isWindows ? 'alt' : 'meta'}+${i.toString()}`),
|
[...Array(10).keys()].map(i => `ctrl+${isWindows ? 'alt' : 'meta'}+${i.toString()}`),
|
||||||
e => {
|
e => {
|
||||||
|
e.preventDefault()
|
||||||
const index = e.key === '0' ? 9 : Number(e.key) - 1
|
const index = e.key === '0' ? 9 : Number(e.key) - 1
|
||||||
const itemId = clipboardHistory[Number(index)]?.historyId
|
const itemId = clipboardHistory[Number(index)]?.historyId
|
||||||
|
|
||||||
@ -339,6 +363,9 @@ export default function ClipboardHistoryPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPastedItem(itemId)
|
setPastedItem(itemId)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enableOnFormTags: ['input'],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -246,6 +246,28 @@ export default function ClipboardHistoryQuickPastePage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
invokeCopyPasteHistoryItem(itemId)
|
invokeCopyPasteHistoryItem(itemId)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enableOnFormTags: ['input'],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
useHotkeys(
|
||||||
|
[...Array(10).keys()].map(i => `meta+${i.toString()}`),
|
||||||
|
e => {
|
||||||
|
e.preventDefault()
|
||||||
|
const index = e.key === '0' ? 9 : Number(e.key) - 1
|
||||||
|
const itemId = clipboardHistory[Number(index)]?.historyId
|
||||||
|
|
||||||
|
if (!itemId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
invokeCopyPasteHistoryItem(itemId)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enabled: !isWindows,
|
||||||
|
enableOnFormTags: ['input'],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -682,6 +704,7 @@ export default function ClipboardHistoryQuickPastePage() {
|
|||||||
setSavingItem={setSavingItem}
|
setSavingItem={setSavingItem}
|
||||||
isDeleting={false}
|
isDeleting={false}
|
||||||
isSelected={false}
|
isSelected={false}
|
||||||
|
isWindows={isWindows}
|
||||||
setBrokenImageItem={setBrokenImageItem}
|
setBrokenImageItem={setBrokenImageItem}
|
||||||
isBrokenImage={brokenImageItems.includes(historyId)}
|
isBrokenImage={brokenImageItems.includes(historyId)}
|
||||||
showTimeAgo={false}
|
showTimeAgo={false}
|
||||||
@ -855,6 +878,7 @@ export default function ClipboardHistoryQuickPastePage() {
|
|||||||
hasGenerateLinkMetaDataInProgress={clipboardHistoryGenerateLinkMetaDataInProgress.includes(
|
hasGenerateLinkMetaDataInProgress={clipboardHistoryGenerateLinkMetaDataInProgress.includes(
|
||||||
historyId
|
historyId
|
||||||
)}
|
)}
|
||||||
|
isWindows={isWindows}
|
||||||
setHistoryFilters={setHistoryFilters}
|
setHistoryFilters={setHistoryFilters}
|
||||||
setAppFilters={setAppFilters}
|
setAppFilters={setAppFilters}
|
||||||
setSelectHistoryItem={() => {}}
|
setSelectHistoryItem={() => {}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user