mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 09:27:23 +00:00
InputBox: tune input attributes
This commit is contained in:
parent
92e874e263
commit
39e8b8a526
2 changed files with 20 additions and 5 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
import { h } from 'preact'
|
import { h } from 'preact'
|
||||||
import { useEffect, useRef, useState } from 'preact/hooks'
|
import { useEffect, useRef, useState } from 'preact/hooks'
|
||||||
|
|
||||||
|
import s from './InputBox/MenuButton.module.scss'
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
const keyCodes = {
|
const keyCodes = {
|
||||||
KEY_BACKSPACE: 8,
|
KEY_BACKSPACE: 8,
|
||||||
|
|
@ -111,9 +113,6 @@ export default function InputBox ({
|
||||||
const inputHandlers = {
|
const inputHandlers = {
|
||||||
char: {
|
char: {
|
||||||
maxlength: '1',
|
maxlength: '1',
|
||||||
autocapitalize: 'off',
|
|
||||||
autocorrect: 'off',
|
|
||||||
spellcheck: 'false',
|
|
||||||
placeholder: 'Press any key here',
|
placeholder: 'Press any key here',
|
||||||
onKeyDown: charHandler,
|
onKeyDown: charHandler,
|
||||||
},
|
},
|
||||||
|
|
@ -136,12 +135,15 @@ export default function InputBox ({
|
||||||
value={inputText}
|
value={inputText}
|
||||||
autofocus
|
autofocus
|
||||||
autocomplete='off'
|
autocomplete='off'
|
||||||
|
spellCheck='false'
|
||||||
|
autocapitalize='off'
|
||||||
|
autocorrect='off'
|
||||||
onDblClick={onFullscreenRequest}
|
onDblClick={onFullscreenRequest}
|
||||||
onInput={({ target: { value } }) => setInputText(value)}
|
onInput={({ target: { value } }) => setInputText(value)}
|
||||||
type='text' />
|
type='search' />
|
||||||
<button
|
<button
|
||||||
aria-label='Menu'
|
aria-label='Menu'
|
||||||
className='menuButton'
|
className={s.menuButton}
|
||||||
onClick={() => setMenuOpen(true)}
|
onClick={() => setMenuOpen(true)}
|
||||||
>
|
>
|
||||||
=
|
=
|
||||||
|
|
|
||||||
13
src/components/Player/InputBox/MenuButton.module.scss
Normal file
13
src/components/Player/InputBox/MenuButton.module.scss
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
.menuButton {
|
||||||
|
border-left: none;
|
||||||
|
outline-offset: -8px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
|
||||||
|
&:focus-visible {
|
||||||
|
outline-offset: -4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue