mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Limit length of soft descriptor in front and backend
This commit is contained in:
parent
606c1e27c0
commit
d7829b11d3
3 changed files with 23 additions and 2 deletions
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue