Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input-compatible props to select-like elements and DatePicker #63

Merged
merged 4 commits into from
Oct 1, 2019

Conversation

yhatt
Copy link
Owner

@yhatt yhatt commented Sep 30, 2019

Added props of <Input> to select-like elements and <DatePicker>, and wrap in <Input> automatically when using these. It allows HTML form style templating.

By this implementation, JSX for outdated dialog (@speee-js/jsx-slack/dialog) can migrate into modal with minimum changes in template.

<Dialog callbackId="createUser" title="Create user">
  <UsersSelect name="user" label="User" required />
  <Select name="role" label="Role" value="regular" required>
    <Option value="regular">Regular</Option>
    <Option value="leader">Leader</Option>
    <Option value="admin">Admin</Option>
  </Select>
</Dialog>

In this case, just change from Dialog to Modal.

<Modal callbackId="createUser" title="Create user">
  <UsersSelect name="user" label="User" required />
  <Select name="role" label="Role" value="regular" required>
    <Option value="regular">Regular</Option>
    <Option value="leader">Leader</Option>
    <Option value="admin">Admin</Option>
  </Select>
</Modal>

Yuki Hattori added 3 commits September 30, 2019 20:03
@yhatt yhatt changed the title Add input-compatible props to select-like elements Add input-compatible props to select-like elements and DatePicker Sep 30, 2019
@yhatt yhatt merged commit e204b08 into master Oct 1, 2019
@yhatt yhatt deleted the input-props-for-select branch October 1, 2019 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant