Skip to content

Commit

Permalink
Merge pull request github#13797 from github/repo-sync
Browse files Browse the repository at this point in the history
repo sync
  • Loading branch information
Octomerger authored Jan 6, 2022
2 parents 01801f8 + 5bc44c8 commit 3e38120
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 29 deletions.
61 changes: 32 additions & 29 deletions components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,35 +209,38 @@ export function Search({
<div data-testid="search" aria-hidden="true">
<div className="position-relative z-2">
<form role="search" className="width-full d-flex" noValidate onSubmit={onFormSubmit}>
<input
data-testid="site-search-input"
ref={inputRef}
className={cx(
styles.searchInput,
iconSize === 24 && 'form-control px-6 f4',
iconSize === 16 && 'form-control px-5 f4',
variant === 'compact' && 'py-2',
variant === 'expanded' && 'py-3',
isHeaderSearch && styles.searchInputHeader,
!isHeaderSearch && 'width-full',
isHeaderSearch && query && styles.searchInputExpanded,
isHeaderSearch && query && 'position-absolute top-0 right-0'
)}
style={{
background: `var(--color-canvas-default) url("/assets/images/octicons/search-${iconSize}.svg") no-repeat ${
iconSize === 24 ? '12px' : '6px'
}`,
}}
type="search"
placeholder={t`placeholder`}
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
maxLength={512}
onChange={onSearch}
value={localQuery}
/>
<label className="text-normal width-full">
<span className="visually-hidden">{t`placeholder`}</span>
<input
data-testid="site-search-input"
ref={inputRef}
className={cx(
styles.searchInput,
iconSize === 24 && 'form-control px-6 f4',
iconSize === 16 && 'form-control px-5 f4',
variant === 'compact' && 'py-2',
variant === 'expanded' && 'py-3',
isHeaderSearch && styles.searchInputHeader,
!isHeaderSearch && 'width-full',
isHeaderSearch && query && styles.searchInputExpanded,
isHeaderSearch && query && 'position-absolute top-0 right-0'
)}
style={{
background: `var(--color-canvas-default) url("/assets/images/octicons/search-${iconSize}.svg") no-repeat ${
iconSize === 24 ? '12px' : '6px'
}`,
}}
type="search"
placeholder={t`placeholder`}
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"
spellCheck="false"
maxLength={512}
onChange={onSearch}
value={localQuery}
/>
</label>
<button className="d-none" type="submit" title="Submit the search query." hidden />
</form>
</div>
Expand Down
11 changes: 11 additions & 0 deletions stylesheets/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,14 @@
.min-h-screen {
min-height: 100vh;
}

.visually-hidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute !important;
width: 1px;
}

0 comments on commit 3e38120

Please sign in to comment.