olahol / react-tagsinput

Highly customizable React component for inputing tags.
MIT License
1.35k stars 233 forks source link

Mobile devices cannot add tags - enter does not submit tags but instead moves to next form field #201

Open VexyCats opened 4 years ago

VexyCats commented 4 years ago
  <Form.Group controlId="formBasicEmail" className={styles.appFormgroup}>
      <Form.Label className={styles.appInfolabel}>{label}</Form.Label>
      <TagsInput
        className={styles.appTagsblock}
        onChange={onChange}
        onChangeInput={onChangeInput}
        inputValue={inputValue}
        value={value || []}
        maxTags={8}
        addKeys={[9, 13]}
        maxlength="16"
        {...props}
      />
      {touched && invalid && (
        <div
          className="signerror"
        >
          {error}
        </div>
      )}
    </Form.Group>

Works fine on computer/browser. On mobile enter will only go to the next field and not actually submit the tags.

sushanyadav commented 4 years ago

Same issue.

solved it by wrapping TagsInput with form

 <form>
 <TagsInput/>
 </form>

But form cannot be nested . :(