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

fix(picker): picker prompt also need the value prop #1172

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/zarm/src/picker/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ ReactDOM.render(<Demo />, mountNode);
Picker 支持指令式调用,提供了 `prompt` 方法

```tsx
prompt: (props: Omit<PickerProps, 'visible' | 'visible' | 'children'>) =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

value 属性还是需要的吧,只是这里的文档有错误,应该是 'value' | 'visible' | 'children'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

prompt 如果不支持 value ,已选项没法正确回填

prompt: (props: Omit<PickerProps, 'visible' | 'children'>) =>
Promise<PickerValue[] | null>;
```

Expand Down
2 changes: 1 addition & 1 deletion packages/zarm/src/picker/prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface PickerPromptValue {
items: PickerColumnItem[];
}

export const prompt = (props: Omit<PickerProps, 'value' | 'visible' | 'children'>) => {
export const prompt = (props: Omit<PickerProps, 'visible' | 'children'>) => {
return new Promise<PickerPromptValue>((resolve) => {
const { close } = renderImperatively(
<Picker
Expand Down
Loading