Mishig commited on
Commit
3edef03
1 Parent(s): 08e8583

[Frontend] keypress -> keydown (#800)

Browse files
src/lib/components/SystemPromptModal.svelte CHANGED
@@ -12,7 +12,7 @@
12
  type="button"
13
  class="mx-auto flex items-center gap-1.5 rounded-full border border-gray-100 bg-gray-50 px-3 py-1 text-xs text-gray-500 hover:bg-gray-100 dark:border-gray-800 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700"
14
  on:click={() => (isOpen = !isOpen)}
15
- on:keypress={(e) => e.key === "Enter" && (isOpen = !isOpen)}
16
  >
17
  <CarbonBlockchain class="text-xxs" /> Using Custom System Prompt
18
  </button>
 
12
  type="button"
13
  class="mx-auto flex items-center gap-1.5 rounded-full border border-gray-100 bg-gray-50 px-3 py-1 text-xs text-gray-500 hover:bg-gray-100 dark:border-gray-800 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700"
14
  on:click={() => (isOpen = !isOpen)}
15
+ on:keydown={(e) => e.key === "Enter" && (isOpen = !isOpen)}
16
  >
17
  <CarbonBlockchain class="text-xxs" /> Using Custom System Prompt
18
  </button>
src/lib/components/WebSearchToggle.svelte CHANGED
@@ -9,13 +9,13 @@
9
  <div
10
  class="flex h-8 cursor-pointer select-none items-center gap-2 rounded-lg border bg-white p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900"
11
  on:click={toggle}
12
- on:keypress={toggle}
13
  aria-checked={$webSearchParameters.useSearch}
14
  aria-label="web search toggle"
15
  role="switch"
16
  tabindex="0"
17
  >
18
- <Switch name="useSearch" bind:checked={$webSearchParameters.useSearch} on:click on:keypress />
19
  <div class="whitespace-nowrap text-sm text-gray-800 dark:text-gray-200">Search web</div>
20
  <div class="group relative w-max">
21
  <CarbonInformation class="text-xs text-gray-500" />
 
9
  <div
10
  class="flex h-8 cursor-pointer select-none items-center gap-2 rounded-lg border bg-white p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900"
11
  on:click={toggle}
12
+ on:keydown={toggle}
13
  aria-checked={$webSearchParameters.useSearch}
14
  aria-label="web search toggle"
15
  role="switch"
16
  tabindex="0"
17
  >
18
+ <Switch name="useSearch" bind:checked={$webSearchParameters.useSearch} on:click on:keydown />
19
  <div class="whitespace-nowrap text-sm text-gray-800 dark:text-gray-200">Search web</div>
20
  <div class="group relative w-max">
21
  <CarbonInformation class="text-xs text-gray-500" />
src/lib/components/chat/ChatMessage.svelte CHANGED
@@ -138,7 +138,7 @@
138
  class="group relative -mb-8 flex items-start justify-start gap-4 pb-8 leading-relaxed"
139
  role="presentation"
140
  on:click={() => (isTapped = !isTapped)}
141
- on:keypress={() => (isTapped = !isTapped)}
142
  >
143
  {#if $page.data?.assistant?.avatar}
144
  <img
 
138
  class="group relative -mb-8 flex items-start justify-start gap-4 pb-8 leading-relaxed"
139
  role="presentation"
140
  on:click={() => (isTapped = !isTapped)}
141
+ on:keydown={() => (isTapped = !isTapped)}
142
  >
143
  {#if $page.data?.assistant?.avatar}
144
  <img