Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
114 stars 70 forks source link

ui-editor: Hover state get stuck on DND #8897

Closed mijohansen closed 1 year ago

mijohansen commented 2 years ago

When dragging and dropping elements in the ui-editor the hoverstate is not changed. This means that the background of the element at the position of the dragged item is white and the Editbutton is still there. Problem is observerd i chrome, and widely discussed amoung react-dnd-users.

image.png

I think this is due to the fact that the view is using hover state to display these features instead of manualy using onMouseEnter / onMouseLeave and just propagate the hover-state to subcomponents manually displaying the items that should be showed:

image (1).png

There are several benefits of going with the non-css alternative. You get better control over components and how they are displayed and needless to say, its easier to make tools accessible. Its really the focus of an element that should display the buttons, not the hover state.

Its also easier to test, as the state could be showed programmaticly.

mijohansen commented 1 year ago

This one is not relevant as @TomasEng have changed this area of the code... se #9218