slim-select icon indicating copy to clipboard operation
slim-select copied to clipboard

moveContentAbove doesn't respect ss-content margin

Open ugrupp opened this issue 5 years ago • 2 comments

When the ss-content box is put above the select, the margin values of .ss-content are not respected in the calculation.

This line calculates the content box height via offsetHeight, which doesn't account for the margins set in CSS: https://github.com/brianvoe/slim-select/blob/a091b626806430b7c3f6dfb63f5a43909c8c9cc6/src/slim-select/index.ts#L336

In my case, .ss-content has vertical margins set to 4px, so i can have some breathing room between the select and the content box. It works fine when the content box is 'below', since there's no position calculation needed.

Maybe that spacing could be a configurable option which can be added to the line that sets the negative top margin for the content box: https://github.com/brianvoe/slim-select/blob/a091b626806430b7c3f6dfb63f5a43909c8c9cc6/src/slim-select/index.ts#L338

ugrupp avatar Nov 23 '19 01:11 ugrupp

Can you post screen shots of what you are seeing please

brianvoe avatar Nov 23 '19 04:11 brianvoe

Sure!

Content box above (without space):

image

Content box below (with correct space):

image

ugrupp avatar Nov 23 '19 16:11 ugrupp

New version of slim select has been released. If this is still an issue let me know and ill try to take care of it.

brianvoe avatar Nov 21 '22 01:11 brianvoe