fix(ui): max length for variant and flag key

This commit is contained in:
nick-delirium 2023-07-06 16:32:00 +02:00
parent 9a5d7d53a6
commit f9ce134f44
2 changed files with 4 additions and 2 deletions

View file

@ -78,9 +78,10 @@ function Multivariant() {
<Input
placeholder={`buy-btn-variant-${ind + 1}`}
value={variant.value}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
if (e.target.value?.length > 25) return;
variant.setKey(e.target.value)
}
}}
/>
</div>
<div style={{ flex: 4 }}>

View file

@ -103,6 +103,7 @@ function NewFFlag({ siteId, fflagId }: { siteId: string; fflagId?: string }) {
placeholder={'new-unique-key'}
value={current.flagKey}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
if (e.target.value?.length > 60) return;
current.setFlagKey(e.target.value.replace(/\s/g, '-'));
}}
/>