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

Feat defaultClickAction prop #1420

Merged
merged 6 commits into from
Sep 20, 2023
Merged

Feat defaultClickAction prop #1420

merged 6 commits into from
Sep 20, 2023

Conversation

takurinton
Copy link
Contributor

Action prop でデフォルトで選択されてるアクションを表示したいユースケースがありそう

@changeset-bot
Copy link

changeset-bot bot commented Sep 20, 2023

🦋 Changeset detected

Latest commit: 713057e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ingred-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Sep 20, 2023

Deploy Preview for ingred-ui ready!

Name Link
🔨 Latest commit 713057e
🔍 Latest deploy log https://app.netlify.com/sites/ingred-ui/deploys/650a8a2f61353000086c448c
😎 Deploy Preview https://deploy-preview-1420--ingred-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@takurinton
Copy link
Contributor Author

takurinton commented Sep 20, 2023

これだとカレンダーの開閉でステートがリセットされてしまうな...。
親コンポーネントで持てる場合はいいんだけど、それがない場合の挙動として不健全だ

親コンポーネントで持ちたくない場合はそもそも defaultClickAction を渡さなければいいのでこれはこれで良さそう。
しかし、渡す場合は親コンポーネントで click action のステートを持つ必要がある。

@takurinton
Copy link
Contributor Author

となると onActionClick が欲しくなる...。

@@ -79,6 +79,58 @@ export const WithActions: StoryObj<NewDateRangePickerProps> = {
},
};

export const WithActionsWithDefaultClickAction: StoryObj<NewDateRangePickerProps> =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ用の story 追加しておいた。

@takurinton takurinton merged commit fe0c31e into master Sep 20, 2023
3 checks passed
@takurinton takurinton deleted the feat-default-click-action branch September 20, 2023 06:02
@FluctMember FluctMember mentioned this pull request Sep 20, 2023
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.

None yet

2 participants