jakezatecky / react-dual-listbox

A feature-rich dual listbox for React.
https://jakezatecky.github.io/react-dual-listbox/
MIT License
109 stars 59 forks source link

Some Icons are not being render: moveLeft, moveAllLeft, moveRight and moveAllRight #272

Closed amandabrbz closed 2 months ago

amandabrbz commented 3 months ago

Describe the bug I'm using the v6.0.3 in my project react + typescript, and for some reason, the moveLeft, moveAllLeft, moveRight and moveAllRight icons are not being rendered like moveDown, moveUp, moveTop and moveBottom.

Screenshot 2024-03-28 at 12 09 05

It seems that the object isn't accepting JSX.Elements, and it's rendering the default, which doesn't have the appropriate classes in the export CSS.

Screenshot 2024-03-28 at 12 07 20

Screenshot 2024-03-28 at 12 12 37

"dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-dual-listbox": "^6.0.3",
    "react-icons": "^4.3.1"
}

Expected behavior

Show correct icons:

Screenshot 2024-03-28 at 12 06 52

Here I just downgraded to "react-dual-listbox": "^5.0.2"

jakezatecky commented 3 months ago

Hello. This is because in v6 we renamed some of the icons property:

The keys moveLeft, moveAllLeft, moveRight, and moveAllRight are now moveToAvailable, moveAllToAvailable, moveToSelected, and moveAllToSelected in all instances. Refer to the table below to rename any affected icons or lang keys:

Old Key Name New Key Name
moveLeft moveToAvailable
moveAllLeft moveAllToAvailable
moveRight moveToSelected
moveAllRight moveAllToSelected

The name change was because left and right assumes a left-to-right (LTR) configuration. I wanted this component to be more cognizant of right-to-left (RTL) languages.

amandabrbz commented 3 months ago

Thanks @jakezatecky for explaining!

In the documentation it's referring to the old way, do you mind if I raise a PR for updating it or what's the best way of doing it?

jakezatecky commented 3 months ago

That is an unfortunate oversight. Yes, you may submit a PR to fix this.

chiragwootag commented 2 months ago

Please fix this.