-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: recentered form view #591
Conversation
3dfd494
to
eac9855
Compare
eac9855
to
4978c9b
Compare
4978c9b
to
fd48e08
Compare
I've had to skip one of the tests to work. Generally, I think this test will give us problems in the future. @pinussilvestrus I think I'd leave the decision to you on how to handle this one. IMO it's just a really annoying behavior to test, because it's never really clear when those UI frameworks update the DOM, which is even harder to handle considering dragging shuffles everything around. Adding 100 pixels to the x of the drag fixes the test locally for me, but not on ci. Overall my fix simply takes the drag handle out of the placement hierarchy. I've also removed an override we were doing on the basic carbon grid component which was the cause of this pretty large outer band. Instead, we should configure the padding outside of the carbon grid components if we really want more spacing than carbon provides (which I've done here, added 4px of padding on each side. The active area of the drag handle can be modified as you guys see fit, @christian-konrad @RomanKostka please view the deployment and let me know if the feel is right. If not, I can always increase the area where the drag handle is active. I can also increase the padding, as my 'fix' definitely reduced the space on each side. I notice that on the deployment, the handle is not quite centered, this is something we'd have to adjust on the playground styles. But assume it is during testing. It looks like this on form-js proper: |
I notice that the css change made the dragging in of new components a little more finicky, I'll investigate. Still, feel free to review the row dragging in isolation. |
@@ -992,7 +992,7 @@ describe('FormEditor', function() { | |||
}); | |||
|
|||
|
|||
it('should move row', async function() { | |||
it.skip('should move row', async function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes laggy due to the absolute positioning now, I think. That's always hard to test, so I got your rationale about this particular test.
In general, I think the dragging tests make sense, as the behavior is predictable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we at least add an comment above the test why we skip it and maybe a note that we could solve it with proper integration testing? Or should we remove it entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try to move this test o Playwright when I create the setup
@@ -404,11 +409,7 @@ | |||
/* row drop preview */ | |||
.fjs-children > .gu-transit { | |||
height: 28px !important; | |||
margin-left: 28px !important; | |||
margin-right: -8px !important; | |||
flex: unset !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
only the issue with the broken preview we should take a look at.
#591 (comment)
Closes #582
fd48e08
to
fe01fb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recentering looks good 🎉
unfortunately i found some other weird behavior:
the drop is only possible at certain areas
weird-behavior.mov
@RomanKostka @Skaiir this is a known bug due to the current way dragula calculates the drop position. This will be fixed via #588 or once we migrate to |
Closes #582