sourcegraph/client/wildcard
Quinn Slack a0c4f2f7c8
make <Label> element focus & select at end to match native label behavior (#63568)
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.
2024-07-01 08:41:56 -07:00
..
src make <Label> element focus & select at end to match native label behavior (#63568) 2024-07-01 08:41:56 -07:00
.eslintignore Add PageSelector component and create new Wildcard component library (#19026) 2021-03-17 08:44:51 +00:00
.stylelintrc.json web: integrate @sourcegraph/stylelint-plugin-sourcegraph and ban bootstrap imports (#34956) 2022-05-05 04:27:26 +00:00
BUILD.bazel feat(search/svelte): Support more file icons (#63181) 2024-06-12 15:59:32 +02:00
OWNERS Add @vovakulikov to wildcard OWNERS (#44613) 2022-11-18 15:09:50 -03:00
package.json Remove Wildcard's dependency on @sourcegraph/common (#61781) 2024-04-15 12:26:02 +02:00
README.md fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
tsconfig.json Remove Wildcard's dependency on @sourcegraph/common (#61781) 2024-04-15 12:26:02 +02:00
vitest.config.ts reapply "switch from jest to vitest for faster, simpler tests (#57886)" (#58145) 2023-11-07 12:00:18 +02:00

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 components
    • hooks/ Reusable React hooks. Typically utilities or headless components

See Wildcard documentation for more information.