Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

:wheelchair: Improving accessibility

Liyas Thomas754a1d0f0626
diff --git a/assets/css/styles.scss b/assets/css/styles.scss
index fa20f11c0..db3c16a49 100644
--- a/assets/css/styles.scss
+++ b/assets/css/styles.scss
@@ -590,6 +590,7 @@ pre {
input {
text-transform: uppercase;
+ min-width: 128px;
}
.trigger {
@@ -690,8 +691,12 @@ ul li,
ol li {
display: inline-flex;
flex-flow: column nowrap;
- flex-grow: 1;
+ flex: 1;
justify-content: center;
+
+ &.shrink {
+ flex-grow: 0;
+ }
}
.flex-wrap {
@@ -714,7 +719,7 @@ ol li {
}
.show-on-large-screen {
- display: inline-flex;
+ display: flex;
flex: 1;
}
@@ -791,7 +796,7 @@ ol li {
z-index: 10001;
transform: translateX(-50%);
box-shadow: 0 4px 24px rgba(black, 0.2);
- transition: all .2s ease-in-out;
+ transition: all 0.2s ease-in-out;
}
}
diff --git a/components/layout/history.vue b/components/layout/history.vue
index 0d2984421..712ce4acb 100644
--- a/components/layout/history.vue
+++ b/components/layout/history.vue
@@ -1,20 +1,11 @@
<template>
<pw-section class="green" icon="history" :label="$t('history')" ref="history">
- <ul>
- <div class="show-on-large-screen">
- <li id="filter-history">
- <input
- aria-label="Search"
- type="search"
- :placeholder="$t('search')"
- v-model="filterText"
- />
- </li>
- <button class="icon">
- <i class="material-icons">search</i>
- </button>
- </div>
- </ul>
+ <div class="show-on-large-screen">
+ <input aria-label="Search" type="search" :placeholder="$t('search')" v-model="filterText" />
+ <button class="icon">
+ <i class="material-icons">search</i>
+ </button>
+ </div>
<virtual-list
class="virtual-list"
:class="{ filled: filteredHistory.length }"
@@ -354,9 +345,9 @@ export default {
fb.currentUser !== null
? fb.currentHistory
: JSON.parse(window.localStorage.getItem("history")) || []
- return this.history.filter(entry => {
+ return this.history.filter((entry) => {
const filterText = this.filterText.toLowerCase()
- return Object.keys(entry).some(key => {
+ return Object.keys(entry).some((key) => {
let value = entry[key]
value = typeof value !== "string" ? value.toString() : value
return value.toLowerCase().includes(filterText)
diff --git a/pages/index.vue b/pages/index.vue
index b0345666e..224ffcb11 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -37,145 +37,143 @@
<pw-section class="blue" :label="$t('request')" ref="request">
<ul>
- <div>
- <li>
- <label for="method">{{ $t("method") }}</label>
- <span class="select-wrapper">
- <v-popover>
- <input
- id="method"
- class="method"
- v-if="!customMethod"
- v-model="method"
- readonly
- />
- <input v-else v-model="method" placeholder="CUSTOM" />
- <template slot="popover">
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'GET'
- "
- v-close-popover
- >
- GET
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'HEAD'
- "
- v-close-popover
- >
- HEAD
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'POST'
- "
- v-close-popover
- >
- POST
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'PUT'
- "
- v-close-popover
- >
- PUT
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'DELETE'
- "
- v-close-popover
- >
- DELETE
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'CONNECT'
- "
- v-close-popover
- >
- CONNECT
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'OPTIONS'
- "
- v-close-popover
- >
- OPTIONS
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'TRACE'
- "
- v-close-popover
- >
- TRACE
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = false
- method = 'PATCH'
- "
- v-close-popover
- >
- PATCH
- </button>
- </div>
- <div>
- <button
- class="icon"
- @click="
- customMethod = true
- method = 'CUSTOM'
- "
- v-close-popover
- >
- CUSTOM
- </button>
- </div>
- </template>
- </v-popover>
- </span>
- </li>
- </div>
+ <li class="shrink">
+ <label for="method">{{ $t("method") }}</label>
+ <span class="select-wrapper">
+ <v-popover>
+ <input
+ id="method"
+ class="method"
+ v-if="!customMethod"
+ v-model="method"
+ readonly
+ />
+ <input v-else v-model="method" placeholder="CUSTOM" />
+ <template slot="popover">
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'GET'
+ "
+ v-close-popover
+ >
+ GET
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'HEAD'
+ "
+ v-close-popover
+ >
+ HEAD
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'POST'
+ "
+ v-close-popover
+ >
+ POST
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'PUT'
+ "
+ v-close-popover
+ >
+ PUT
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'DELETE'
+ "
+ v-close-popover
+ >
+ DELETE
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'CONNECT'
+ "
+ v-close-popover
+ >
+ CONNECT
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'OPTIONS'
+ "
+ v-close-popover
+ >
+ OPTIONS
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'TRACE'
+ "
+ v-close-popover
+ >
+ TRACE
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = false
+ method = 'PATCH'
+ "
+ v-close-popover
+ >
+ PATCH
+ </button>
+ </div>
+ <div>
+ <button
+ class="icon"
+ @click="
+ customMethod = true
+ method = 'CUSTOM'
+ "
+ v-close-popover
+ >
+ CUSTOM
+ </button>
+ </div>
+ </template>
+ </v-popover>
+ </span>
+ </li>
<li>
<label for="url">{{ $t("url") }}</label>
<input
@@ -189,17 +187,15 @@
@input="pathInputHandler"
/>
</li>
- <div>
- <li>
- <label class="hide-on-small-screen" for="send">&nbsp;</label>
- <button :disabled="!isValidURL" @click="sendRequest" id="send" ref="sendButton">
- {{ $t("send") }}
- <span>
- <i class="material-icons">send</i>
- </span>
- </button>
- </li>
- </div>
+ <li class="shrink">
+ <label class="hide-on-small-screen" for="send">&nbsp;</label>
+ <button :disabled="!isValidURL" @click="sendRequest" id="send" ref="sendButton">
+ {{ $t("send") }}
+ <span>
+ <i class="material-icons">send</i>
+ </span>
+ </button>
+ </li>
</ul>
<div class="blue">
<label for="label">{{ $t("label") }}</label>