Limit length of soft descriptor in front and backend

This commit is contained in:
carmenmaymo 2025-02-05 15:12:35 +01:00
parent 606c1e27c0
commit d7829b11d3
No known key found for this signature in database
GPG key ID: 6023F686B0F3102E
3 changed files with 23 additions and 2 deletions

View file

@ -0,0 +1,19 @@
import ControlTextInput from './ControlTextInput';
const SoftDescriptorInput = ( { value, onChange, placeholder } ) => {
const handleChange = ( newValue ) => {
if ( newValue.length <= 22 ) {
onChange( newValue );
}
};
return (
<ControlTextInput
value={ value }
onChange={ handleChange }
placeholder={ placeholder }
/>
);
};
export default SoftDescriptorInput;