polaris icon indicating copy to clipboard operation
polaris copied to clipboard

Button within a Popover component has additional clickable area when used within a Card's action prop.

Open cargix1 opened this issue 9 years ago • 2 comments

Issue summary

Button within a Popover component has additional clickable area when used within a Card's action prop.

Expected behavior

I'd expect the Button components min-width to reduce to the size of the icon if no value is provided for the button.

Actual behavior

If you notice when my cursor is off to the left of the horizontalDots icons it changes the cursor to a pointer, and I can click. You'll notice the active state of the Button appear briefly. When I click the mouse the Popover doesn't appear. Only when I am directly on top of the horizontalDots does the Popover appear.

demo

Steps to Reproduce the Problem

  1. Add a Button component as the activator to a Popover component within a Cards action. Ensure no text value is given to the Button, so it's just the horizontalDots that appear.
<Card title="Setup guide" actions={[{content:
	<Popover
		activator={<Button icon="horizontalDots" plain></Button>}
		>
		<ActionList
			items={[
				{content: 'Hide setup guide'}
			]}
		/>
	</Popover>}]}>
	<p>Content</p>
</Card>
  1. Just try hovering over the left hand side of the horizontalDots and you'll notice your cursor change to a pointer.

Specifications

  • Polaris version: 1.1.1
  • React version: 15.4.2
  • Browser: Chrome
  • Device: Macbook Pro
  • Operating System: Sierra

cargix1 avatar Jun 28 '17 18:06 cargix1

Hey @cargix1, thanks for the issue. Card's actions prop is not meant to accept actions with arbitrary HTML, it is meant almost exclusively for actions with string contents. We do have an issue open for discussion in our internal tracker about potentially doing an automatic rollup of actions in cards when there are too many to fit, similar to what you are manually doing here. Until then, though, the recommendation is to limit actions to just simple, text-based ones.

lemonmade avatar Jun 30 '17 13:06 lemonmade

Thanks for letting me know. I guess we can close this issue then :)

cargix1 avatar Jun 30 '17 14:06 cargix1