Skip to content
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] web: remove extra space in kanban dragging images #29642

Closed
wants to merge 1 commit into from

Conversation

ged-odoo
Copy link
Contributor

While dragging kanban record which have a cover image set, the kanban view
creates extra space, which makes it difficult to properly target a
position.

This is because of a jquery.ui issue for sortable when helper=clone is used.
In that case, then jquery.ui sortable will create a clone of current element
after hiding it. Note that jquery.ui tries to get height to current dragged
element after making it hidden(display: none) and display: none, so the element
does not return actual height and hence it gives innerHeight which considers
height of the image also and extra space is generated.

An alternative solution is to add start event in sortable option and

  1. show ui.item
  2. get height of the element and
  3. hide ui.item, which gives proper height of the current dragged element

But removing helper=clone will also fix the issue and is not actually required.
Note that some special care had to be done to prevent the click from the
drag and drop operation to actually open the record.

Related to task: #1865788
Closes: #25734

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

While dragging kanban record which have a cover image set, the kanban view
creates extra space, which makes it difficult to properly target a
position.

This is because of a jquery.ui issue for sortable when helper=clone is used.
In that case, then jquery.ui sortable will create a clone of current element
after hiding it. Note that jquery.ui tries to get height to current dragged
element after making it hidden(display: none) and display: none, so the element
does not return actual height and hence it gives innerHeight which considers
height of the image also and extra space is generated.

An alternative solution is to add start event in sortable option and
1) show ui.item
2) get height of the element and
3) hide ui.item, which gives proper height of the current dragged element

But removing helper=clone will also fix the issue and is not actually required.
Note that some special care had to be done to prevent the click from the
drag and drop operation to actually open the record.

Related to task: #1865788
Closes: odoo#25734
@aab-odoo
Copy link
Contributor

robodoo r+

@C3POdoo C3POdoo added the RD research & development, internal work label Dec 19, 2018
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Dec 19, 2018
robodoo pushed a commit that referenced this pull request Dec 19, 2018
While dragging kanban record which have a cover image set, the kanban view
creates extra space, which makes it difficult to properly target a
position.

This is because of a jquery.ui issue for sortable when helper=clone is used.
In that case, then jquery.ui sortable will create a clone of current element
after hiding it. Note that jquery.ui tries to get height to current dragged
element after making it hidden(display: none) and display: none, so the element
does not return actual height and hence it gives innerHeight which considers
height of the image also and extra space is generated.

An alternative solution is to add start event in sortable option and
1) show ui.item
2) get height of the element and
3) hide ui.item, which gives proper height of the current dragged element

But removing helper=clone will also fix the issue and is not actually required.
Note that some special care had to be done to prevent the click from the
drag and drop operation to actually open the record.

Related to task: #1865788
Closes: #25734

closes #29642
@robodoo
Copy link
Contributor

robodoo commented Dec 19, 2018

Merged, thanks!

@robodoo robodoo closed this Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants