Skip to content

Commit

Permalink
fix: 移动端picker label为对象时页面白屏 (#11299)
Browse files Browse the repository at this point in the history
* fix: 移动端picker label为对象时页面白屏

* Update PickerColumn.tsx

---------

Co-authored-by: zhangxulong <[email protected]>
  • Loading branch information
z1769057083 and zhangxulong authored Dec 2, 2024
1 parent 397e609 commit e318252
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit e318252

Please sign in to comment.