BBBCheckbox: no visible keyboard focus, and the label ignores disabled
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
调研方向
从 src/components/Checkbox/styles.ts 开始,其中 StyledCheckbox 为 .MuiCheckbox-root 设置 padding: 0,Label 设置光标样式;然后查看 component.tsx,其中渲染了 Label,并且可以使用 disabled。检查 src/components/Button/styles.ts 中的焦点轮廓,找到可以复用的 token,并确认通过 Tab 切换时如何应用 .Mui-focusVisible。完成标准是:键盘焦点显示可见的轮廓,且禁用复选框的标签使用 not-allowed 光标和禁用文本颜色。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
BBBCheckbox has two state-styling gaps.
- There is no visible keyboard focus.
StyledCheckboxsetspadding: 0on.MuiCheckbox-root, so MUI's focus ripple only tints the inside of the 21px box. On a light background it is a faint grey square, easy to miss. Nothing else marks focus: there's no outline and no.Mui-focusVisiblestyle. With MUI's default 9px padding, the same ripple shows as a 39px halo.BBButton, for comparison, draws a 2px outline on focus (&&:focus). - The label ignores
disabled.Labelalways hascursor: pointerand the default text color. The component doesn't passdisabledto it (component.tsx). Withdisabled, MUI dims the box, but the label still looks and points as if it were clickable.
To Reproduce
- Render
<BBBCheckbox label="Whole image" checked={false} onChange={() => {}} />. - Tab to it. The only focus cue is a faint tint inside the box.
- Render it with
disabledand hover the label. The cursor is a pointer and the label text isn't dimmed.
Expected behavior
- Focus: a clearly visible focus indicator when focused from the keyboard (
:focus-visible/.Mui-focusVisible), consistent withBBButton's focus outline. WCAG 2.4.7 (Focus Visible) requires one. - Disabled: when
disabled, the label showscursor: not-allowed(ordefault) and the disabled text color, like the box.
Actual behavior
- Focus: a faint grey square inside the 21px box.
- Disabled: the label keeps
cursor: pointerand full-contrast text.
Screenshots
Can add if useful. On keyboard focus, the box shows a light grey fill inside its 21px border and nothing outside it.
BBB version, plugin in which the bug happened and SDK version:
- bbb-ui-components-react 0.9.0, and
developat ccef0a330. - Found while switching the BigBlueButton 4.0 client's camera settings ("Whole image" brightness option) from its own MUI checkbox to
BBBCheckbox.
Desktop (please complete the following information):
- OS: Linux
- Browser: Chromium
- Version: Playwright's bundled Chromium
Additional context
A possible fix:
export const StyledCheckbox = styled(MuiCheckbox)`
&.MuiCheckbox-root { padding: 0; }
&.Mui-checked { color: ${colorBrand1}; }
&.Mui-focusVisible { outline: 2px solid <same token as BBButton's focus outline>; outline-offset: 2px; }
`;
export const Label = styled.label<{ $disabled?: boolean }>`
...
cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'pointer')};
${({ $disabled }) => $disabled && `color: <disabled text token>;`}
`;
The component would pass $disabled={props.disabled} to Label.
- 主要语言
- TypeScript
- 星标
- 2
- 派生
- 5
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bigbluebutton/bbb-ui-components-react 的其他 Issue
-
BBButton: subtle variant with neutral color has an opaque white background, so it renders white on white in dark mode可能重新可做 @nisatsama 于 11 天前认领,目前没有进行中的 PR。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
bigbluebutton/bbb-ui-components-react#100 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
bigbluebutton/bbb-ui-components-react#107 ·
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 55/100
bigbluebutton/bbb-ui-components-react#106 ·
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 45/100
bigbluebutton/bbb-ui-components-react#105 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 30/100
bigbluebutton/bbb-ui-components-react#87 ·
维护者通常 1 天内回复
查看 bigbluebutton/bbb-ui-components-react 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 83/100
-
难度 2/5 1-3 小时 新手友好度 72/100
ranxianglei/billion-context#3583 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 76/100
callstackincubator/simlock#673 ·
维护者通常 1 天内回复
-
documentation v3
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
anomalyco/opencode#56380 · 1 条评论 ·
维护者通常 1 天内回复