ui icon indicating copy to clipboard operation
ui copied to clipboard

Position of switch issue

Open jwoertink opened this issue 2 years ago • 6 comments

Love the look of this! Just saw this example on the demo site using Firefox 108 on Linux Pop!_OS 22.

image image image

You can see the button looks like it's hanging outside a little. Super minor, so not really a big deal, but I figured I'd report it anymore.

Thanks!

jwoertink avatar Jan 26 '23 16:01 jwoertink

Can confirm i also get a similar issue on chrome, my button is off center to the top, and whats weirder is that it changes how central it is with user zoom.

90% Zoom image

100% Zoom image

DevMaxC avatar Jan 29 '23 01:01 DevMaxC

@jwoertink @DevMaxC Are you both on Linux?

shadcn avatar Jan 29 '23 10:01 shadcn

I got this issue as well, I'm on Linux. but this occurs on some screens sizes, If I change the zoom or the screen size.

I solve that by putting the items-center on in this part of switch.tsx ui component.

 <SwitchPrimitives.Root
    className={cn(
      "peer inline-flex items-center h-[24px] w-[44px] shrink-0 ....",
      className
    )}
    {...props}
    ref={ref}
  >

lucaspessivaldo avatar Jan 29 '23 14:01 lucaspessivaldo

@lucaspessivaldo Thanks for the update.

@jwoertink @DevMaxC does adding items-center fix the issue for you as well? Can you confirm?

If yes, I'll make the change. @lucaspessivaldo Happy to accept a PR as well.

shadcn avatar Jan 29 '23 14:01 shadcn

To me it's all right after that, I'll do the PR

lucaspessivaldo avatar Jan 29 '23 14:01 lucaspessivaldo

Yeah, adding items-center seems to fix it :+1:

jwoertink avatar Jan 29 '23 16:01 jwoertink