dhre-ui-kit 0.0.205 → 0.0.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.mjs CHANGED
@@ -3934,14 +3934,12 @@ const OTPInput = React.forwardRef(
3934
3934
  if (value.length === 1 && regex.test(value) && index >= 0 && index < length) {
3935
3935
  const newOTP = `${otp}${value}`;
3936
3936
  setOTP(newOTP);
3937
- if (index < length - 1) {
3938
- refs.current[index + 1]?.focus();
3939
- }
3937
+ refs.current[index + 1]?.focus();
3940
3938
  } else if (value.length === 0 && index > 0) {
3941
3939
  const newOTP = otp.slice(0, -1);
3942
3940
  setOTP(newOTP);
3943
3941
  refs.current[index - 1]?.focus();
3944
- } else if (value.length === length) {
3942
+ } else if (value?.length === length) {
3945
3943
  setOTP(value);
3946
3944
  refs.current[length - 1]?.focus();
3947
3945
  } else {