-
Notifications
You must be signed in to change notification settings - Fork 14
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
Font size should be cloned from element #15
Comments
Well, if we'd copy the font-size, we might have to copy many more inherited stylings too. Even if this were possible, I'm not sure we wan to do it. |
Ah yes, it will also require a lot of properties. I think the The reason I opened the issue is that the styling of the elements in my project is heavily defined by inheritance, so if I want the elements to look correct while dragging, I have to apply all the styles to the element itself to make it look good. I agree with you that just 'looking good' is not necessarily the job of wicket-dnd, as there are other solutions, I just thought it would we nice if it worked like that out-of-the-box ;) |
Hm, the clone is added to the body currently: I'm wondering why I did it this way. If we added the clone to the parent of the dragged element, it would still be able to inherit all styles. WDYT? |
The main advantage of adding it to the body (as far as I can see) is that is won't affect the rest of the layout and styling. For example, if I have a list and some special style on the last ( The main disadvantage of adding to the body is that the styling is lost in case of inheritance. I'm not sure how much work transferring the calculated style is (I have never done that, but it might be worth an experiment :) I think either will work, my guess is that adding to the body and copying style will provide the most stable and predictable behavior. If I have a moment of less pressure at work I might try to fork and implement it :) |
Yesterday I've tried out adding the hover to the drop target, and it did work quite well. Only problem I found is that the hover with position 'fixed' isn't displayed outside of a parent with overflow:scroll - as I'm using in the TableExample :/. |
Sounds Interesting! But you can you tell where the user will drag a item to? (I have a application where users can drag items from the center-list of the screen to a number of different panels, for example facets on the left, a filter-bar on top, and a garbage can in the upper right corner) |
Sure, detection of drop location works as usual. I've just noticed that the clone has to be added to the dragSource to allow it inherit all parental styles. I'll have to try this. |
Cool. Thanks! |
Ok, seems it wasn't so difficult after all. I've pushed a change to 0.6.x and master to allow configuration via the CSS theme:
I've updated all CSS themes to use position:fixed now, but I might revert it to the old positioning for backwards compatibility. You can easily create your own theme then. TableExample has a red font-color now: when you drag something you see that the clone has a red font too. |
Ah great,
Did I do something wrong or is it not automatically uploaded? |
Sorry, I forgot to deploy it. Should be available soon in the snapshot repository. |
When dragging an element that has a
font-size
that is inherited, thisfont-size
is no longer applied to the dragged-element, making the text bigger (or smaller) and no longer properly fitting the drag-element.Please copy the current font-size of the cloned element as well.
The text was updated successfully, but these errors were encountered: