Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sortable: modified the contents of placeholder to a single " ". …
…Fixed #8135 - sortable: Horizontal sortable shifts causes elements to shift down.
- Loading branch information
b6e1f25
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.
The .html() call clobbers the width/height on the placeholder for both my horizontal and vertical sortables.
To fix it without reverting the nbsp insertion I had to add these lines underneath:
b6e1f25
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.
Well, I am using both and I haven't had any of these problems. Are you sure it's not a CSS fault?
b6e1f25
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.
@shuckster I can confirm that this is a regression. It can be seen in our sortable tabs demo.
b6e1f25
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.
It seems that i defined the placeholder in my CSS, so in my case it does work.
b6e1f25
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.
@scottgonzalez Yes, I'm seeing the same thing.
@bertjh Nothing special in the CSS. There is some colour and padding information that's pulled in from a class-tag, and the width/height information using the style-tag. (There's also a float-left for the horizontal lists, of course). I do have a "position: relative;" set on each list-item, but I've just tested it and it makes no difference.
EDIT: Just saw your new comment. I can indeed set a stylesheet for "ui-sortable-placeholder" that fixes the problem, but I have list-items that can vary in size during the lifetime of the app so that's not a flexible solution for me.
b6e1f25
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.
@bertjh I'm inclined to revert this change since it caused a regression and your use case has an easy workaround. Do you have any ideas for how to fix the regression and your use case at the same time?
b6e1f25
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.
I fixed the problem by changing the "_update" function to
at line 680. Can you confirm?
b6e1f25
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.
Yeah, that fixes it. I had thought the same thing originally, but was afraid that the checks were there for performance reasons. Digging into the code some more, it seems like the calls to
update()
are in appropriate places and this should be fine. Someone actually just filed a bug about this a few minutes ago :-P.b6e1f25
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.
I landed the fix in 4f19289 and marked @bertjh as the author.