Fix HalfLinePaddedBox in screenreader mode. (#17914)

This commit is contained in:
Jacob Richman
2026-01-29 19:21:18 -08:00
committed by GitHub
parent 695785c69d
commit 137080da45
3 changed files with 31 additions and 3 deletions
@@ -6,7 +6,7 @@
import type React from 'react';
import { useMemo } from 'react';
import { Box, Text } from 'ink';
import { Box, Text, useIsScreenReaderEnabled } from 'ink';
import { useUIState } from '../../contexts/UIStateContext.js';
import {
interpolateColor,
@@ -39,7 +39,8 @@ export interface HalfLinePaddedBoxProps {
* at the top and bottom using block characters (▀/▄).
*/
export const HalfLinePaddedBox: React.FC<HalfLinePaddedBoxProps> = (props) => {
if (props.useBackgroundColor === false) {
const isScreenReaderEnabled = useIsScreenReaderEnabled();
if (props.useBackgroundColor === false || isScreenReaderEnabled) {
return <>{props.children}</>;
}