Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Form.Input clickable or Time Picker. #531

Open
SalahAdDin opened this issue Sep 1, 2020 · 0 comments
Open

Form.Input clickable or Time Picker. #531

SalahAdDin opened this issue Sep 1, 2020 · 0 comments

Comments

@SalahAdDin
Copy link

Hi,

I'm making a full dashboard using your package and it is going on, but i had to make some tricky things to get done some things; one of them is a time picker: since this package has no a datetime picker we had to use react-datetimepicker which is useful to make a timepicker though a few cumbersome.

Ass you can see in the documentation, you can use your custom input, but for it you need the onClick event active on it, unfortunately, you are not passing the onClick event to Form Input in this package; hence, we had to make our own timepicker using react-bootstrap which is not a good idea:

  const CustomTimePicker = ({ onClick }) => (
    <Form.Group className="picker-input">
      <Form.Control
        type="text"
        placeholder={placeholder}
        autoComplete="off"
        name={name}
        onChange={handleChange}
        onClick={onClick}
        className={classes}
        disabled={disabled}
        value={value !== '' && value.isValid() ? moment(value).format('HH:mm') : placeholder}
      />
      {feedback && <span className="invalid-feedback">{feedback}</span>}
    </Form.Group>
  );

Then, could you pass the onClick event to the Form Input component? It is easier than create a timepicker component.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant