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 label为对象时页面白屏 #11299

Merged
merged 2 commits into from
Dec 2, 2024
Merged
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
6 changes: 3 additions & 3 deletions packages/amis-ui/src/components/PickerColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import React, {
} from 'react';
import isObject from 'lodash/isObject';
import cloneDeep from 'lodash/cloneDeep';
import {uncontrollable, highlight} from 'amis-core';
import {uncontrollable, highlight, labelToString} from 'amis-core';

import {useSetState, useUpdateEffect} from '../hooks';
import {range} from 'amis-core';
Expand Down Expand Up @@ -96,9 +96,9 @@ const PickerColumn = forwardRef<{}, PickerColumnProps>((props, ref) => {
const getOptionText = (option: [] | PickerOption) => {
if (isObject(option) && labelField in option) {
//@ts-ignore
return option[labelField];
return labelToString(option[labelField]);
}
return option;
return labelToString(option);
};

const getOptionValue = (option: [] | PickerOption) => {
Expand Down
Loading