forked from Mirrors/elk
fix: use "⌘" as modifier key name on macOS (#1506)
* fix: use 'Command' as modifier key name on macOS * fix: use more reliable `useIsMac()` instead of `userAgentData` * refactor: apply suggestion from @userquin * fix: use `⌘` as Command key symbol
This commit is contained in:
parent
fda85e31bc
commit
e197a1dbe9
1 changed files with 5 additions and 2 deletions
|
@ -64,6 +64,9 @@ const result = $computed<QueryResult>(() => commandMode
|
|||
: searchResult,
|
||||
)
|
||||
|
||||
const isMac = useIsMac()
|
||||
const modifierKeyName = $computed(() => isMac.value ? '⌘' : 'Ctrl')
|
||||
|
||||
let active = $ref(0)
|
||||
watch($$(result), (n, o) => {
|
||||
if (n.length !== o.length || !n.items.every((i, idx) => i === o.items[idx]))
|
||||
|
@ -233,8 +236,8 @@ const onKeyDown = (e: KeyboardEvent) => {
|
|||
<!-- Footer -->
|
||||
<div class="flex items-center px-3 py-1 text-xs">
|
||||
<div i-ri:lightbulb-flash-line /> Tip: Use
|
||||
<CommandKey name="Ctrl+K" /> to search,
|
||||
<CommandKey name="Ctrl+/" /> to activate command mode.
|
||||
<CommandKey :name="`${modifierKeyName}+K`" /> to search,
|
||||
<CommandKey :name="`${modifierKeyName}+/`" /> to activate command mode.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue