Skip to content

Commit 8b7b4e8

Browse files
committed
allow for longer item codes
1 parent 6ddbdd7 commit 8b7b4e8

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
import React from 'react';
22
import { ItemRowWithStatsFragment, ItemStockOnHandFragment } from '../../api';
33
import { ItemOption } from '../../utils';
4+
import { Tooltip } from '@common/components';
45

56
export const getItemOptionRenderer =
67
(label: string, formatNumber: (value: number) => string) =>
78
(
89
props: React.HTMLAttributes<HTMLLIElement>,
910
item: ItemStockOnHandFragment | ItemRowWithStatsFragment
1011
) => (
11-
<ItemOption {...props} key={item.code}>
12-
<span style={{ whiteSpace: 'nowrap', width: 100 }}>{item.code}</span>
13-
<span style={{ whiteSpace: 'normal', width: 500 }}>{item.name}</span>
14-
<span
15-
style={{
16-
width: 200,
17-
textAlign: 'right',
18-
// whiteSpace: 'wrap',
19-
}}
20-
>{`${formatNumber(item.availableStockOnHand)} ${label}`}</span>
21-
</ItemOption>
12+
<Tooltip title={`${item.code} ${item.name}`}>
13+
<ItemOption {...props} key={item.code}>
14+
<span
15+
style={{
16+
whiteSpace: 'nowrap',
17+
width: 150,
18+
overflow: 'hidden',
19+
textOverflow: 'ellipsis',
20+
}}
21+
>
22+
{item.code}
23+
</span>
24+
<span style={{ whiteSpace: 'normal', width: 500 }}>{item.name}</span>
25+
<span
26+
style={{
27+
width: 200,
28+
textAlign: 'right',
29+
}}
30+
>{`${formatNumber(item.availableStockOnHand)} ${label}`}</span>
31+
</ItemOption>
32+
</Tooltip>
2233
);

0 commit comments

Comments
 (0)