fix: prevent special key buttons from stealing focus
- Add tabIndex={-1} to all special key buttons to prevent focus
- Add onFocus handler to immediately blur if focused
- Terminal focus stays intact when tapping special keys
This commit is contained in:
@@ -62,7 +62,9 @@ export const SpecialKeysPanel: React.FC<SpecialKeysPanelProps> = ({
|
||||
key={key}
|
||||
className="special-key-button"
|
||||
onPointerDown={(e) => handlePointerDown(e, key)}
|
||||
onFocus={(e) => e.target.blur()}
|
||||
type="button"
|
||||
tabIndex={-1}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
@@ -75,7 +77,9 @@ export const SpecialKeysPanel: React.FC<SpecialKeysPanelProps> = ({
|
||||
key={key}
|
||||
className="special-key-button"
|
||||
onPointerDown={(e) => handlePointerDown(e, key)}
|
||||
onFocus={(e) => e.target.blur()}
|
||||
type="button"
|
||||
tabIndex={-1}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
|
||||
@@ -46,7 +46,9 @@ export const SpecialKeysStrip: React.FC<SpecialKeysStripProps> = ({
|
||||
key={key}
|
||||
className="special-key-button"
|
||||
onPointerDown={(e) => handlePointerDown(e, key)}
|
||||
onFocus={(e) => e.target.blur()}
|
||||
type="button"
|
||||
tabIndex={-1}
|
||||
aria-label={`Send ${label}`}
|
||||
>
|
||||
{label}
|
||||
@@ -56,7 +58,9 @@ export const SpecialKeysStrip: React.FC<SpecialKeysStripProps> = ({
|
||||
<button
|
||||
className="special-key-button special-key-more"
|
||||
onPointerDown={handleMorePointerDown}
|
||||
onFocus={(e) => e.target.blur()}
|
||||
type="button"
|
||||
tabIndex={-1}
|
||||
aria-label="More special keys"
|
||||
>
|
||||
More
|
||||
|
||||
Reference in New Issue
Block a user