mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 16:31:47 +00:00
When our custom `<Label>` element is labelling a contenteditable element (like a CodeMirror editor), it previously just called `element.focus()`. This focused the element but put the cursor at the start. The native and expected behavior of `<label for="...">` is to focus and put the cursor at the end. Also fix an issue where this code path would be followed even if the label had no ID, which could result in it erroneously selecting an element with an empty `aria-labelledby` attribute. ## Test plan In the create/update saved search form, click on the label and ensure it focuses at the end of the CodeMirror component. |
||
|---|---|---|
| .. | ||
| src | ||
| .eslintignore | ||
| .stylelintrc.json | ||
| BUILD.bazel | ||
| OWNERS | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
Wildcard Component Library
Overview
The Wildcard component library is a collection of design-approved reusable components that are suitable for use within the Sourcegraph codebase.
Folder Structure
src/components/Reusable React componentshooks/Reusable React hooks. Typically utilities or headless components
See Wildcard documentation for more information.