Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

factor out PatternConstrainedInput#63869

Merged
sqs merged 1 commit into
mainfrom
sqs/constrained-input
Jul 17, 2024
Merged

factor out PatternConstrainedInput#63869
sqs merged 1 commit into
mainfrom
sqs/constrained-input

Conversation

@sqs

@sqs sqs commented Jul 17, 2024

Copy link
Copy Markdown
Member

This is an input element that constraints the input to look like a path component, used for the names of batch changes (and for prompts in the prompt library in the future).

Also fixes an invalid regexp (it needs to escape - because the 'v' flag is used; see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern).

Test plan

Test against existing batch change create form name input. Try invalid inputs.

@sqs sqs requested a review from a team July 17, 2024 06:52
@cla-bot cla-bot Bot added the cla-signed label Jul 17, 2024
Comment thread client/web/src/components/PatternConstrainedInput.tsx Outdated

@bahrmichael bahrmichael left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 21 to 22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the page you linked to, the pattern is compiled with the v flag. Should we be using that instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thank you, good catch

This is an input element that constraints the input to look like a path component, used for the names of batch changes (and for prompts in the prompt library in the future).
@sqs sqs force-pushed the sqs/constrained-input branch from f3984de to 4adfdef Compare July 17, 2024 08:14
@sqs sqs enabled auto-merge (squash) July 17, 2024 08:14
@sqs sqs merged commit 2947657 into main Jul 17, 2024
@sqs sqs deleted the sqs/constrained-input branch July 17, 2024 08:25
@sqs sqs changed the title factor out PatternContainedInput factor out PatternConstrainedInput Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants