clay icon indicating copy to clipboard operation
clay copied to clipboard

Improve DualListBox API

Open carloslancha opened this issue 3 years ago • 1 comments

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.

carloslancha avatar Sep 28 '21 15:09 carloslancha

LPS Ticket https://liferay.atlassian.net/browse/LPS-190537

matuzalemsteles avatar Jul 13 '23 23:07 matuzalemsteles