clay
clay copied to clipboard
Improve DualListBox API
Current DualListBox API seems a bit confusing to me:
- size: Amount of items that can fit inside the both Select Boxes before a scrollbar is introduced.
Shouldn't it be named maxSize
, maxSideSize
, maxItems
, maxItemsPerSide
or sth like that?
- items: Items spread across two arrays that will be displayed in the two Select Boxes.
This is an array of arrays, where position 0 are the items for the left select box and the position 1 are the items for the right select box. Why don't we make it more explicit? Maybe an object items: { leftItems: [...], rightItems: [...]}
or two different props instead of one leftItems: [], rightItems: []
- left: Props for the left Select Box.
Why not leftProps
or, even better, leftSelectBoxProps
- right: Props for the right Select Box.
The same as above.
Also, I'm not sure about refering to the select boxes as left and right ones, since I guess (I may be wrong) that could change for RTL.
LPS Ticket https://liferay.atlassian.net/browse/LPS-190537