paddy-sketch-plugin icon indicating copy to clipboard operation
paddy-sketch-plugin copied to clipboard

Unexpected sizing results when applying text overrides to symbols

Open tschmeisser opened this issue 6 years ago • 9 comments

Bug report

Sketch 49.1 + Paddy 1.0.7

I'm having unexpected sizing results when applying text overrides to symbols. Image below.

For context, I'm using the pink spacer rectangles to narrow down the issue. I'm not applying padding to the background or spacing between elements as seen in the layer settings. Ideally, I would use Paddy to create the spacing around the text instead of spacers. I've been doing this with the Autolayout plugin for a while, but using one plugin would be even better. The idea is the maintain exact spacing between the elements as text grows from one to many lines as then re-pad the background shape so that I don't have to manually make the symbol/group taller to see all of the content.

In the below example, both groups are the exact same. The second just has more copy in the text boxes and produces the desired result (the box grows vertically).

Happy to add more info if needed. Thanks!

Expected behavior:

The padding, alignment and spacing of a symbol should be maintained when text is overridden.

Actual behavior:

The symbol jumps to the left and resizes. Also does not maintain the centering setting.

example

Steps to reproduce:

Place a clean symbol, override the symbol text and it will jump sideways and grow.

Paddy-Test-031918.sketch.zip

Thanks for your time!

tschmeisser avatar Mar 19 '18 21:03 tschmeisser

Same issue here.... any solutions ?

ghaneshrs avatar Mar 21 '18 15:03 ghaneshrs

I have a similar problem and it matches the title of this issue. The background of my symbol just jumps away completely...

Don't know what i can further do :-( paddybackgroundjump

Thanks a lot

mischugo avatar Mar 26 '18 13:03 mischugo

+1 seeing this issue as well while building tooltips. Seems like when an instance of a symbol is being changed, the base symbol itself is running into issues restoring originalProperties and originalPositions?

zethussuen avatar Mar 27 '18 21:03 zethussuen

I am also running into this issue.

iamhenry avatar Mar 27 '18 21:03 iamhenry

Similar (or same) issue here... button

kium-one avatar Mar 27 '18 22:03 kium-one

Also it's mentioned that the plugin does not modify what's inside symbols, it only resizes symbols themselves, so how come it's being resized? I checked and there are no nested rules in the symbols below that.

kium-one avatar Mar 27 '18 22:03 kium-one

@najiglass it’s not supposed to. If you peek into the source code for symbols.js, you’ll see there is modifications to the base symbol. There just exists a bug where original calculations are not being correctly made I believe.

zethussuen avatar Mar 28 '18 00:03 zethussuen

Thanks all. That's correct @zethussuen. Right now, it sets the overrides in the symbol master itself, then resizes to find the correct size. Then sets all the values back.

I don't think this is a very good approach; so I'm looking into a different way of doing it – which will hopefully mitigate all these issues.

Thanks all for your patience.

DWilliames avatar Apr 01 '18 07:04 DWilliames

yes, I have the same issue. It works fine if this is only a group. When I resize the group the text will flow automatically. However, if I turn the Group into a symbol, and override it with a long text, it will be expanded into one line. Anyway, thank you for the awesome add-on.

chunkitdesign avatar Apr 23 '18 16:04 chunkitdesign