Skip to content

Commit

Permalink
Fix beta button tooltip compatibility with display :block (#1850)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Rohan <jonrohan@github.com>
  • Loading branch information
mayamessinger and jonrohan committed Feb 28, 2023
1 parent 39b477a commit a909eae
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 116 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-crews-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

Fix beta button tooltip compatibility with display :block
2 changes: 1 addition & 1 deletion app/components/primer/beta/button.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render Primer::ConditionalWrapper.new(condition: tooltip.present?, tag: :div, classes: "Button-withTooltip") do -%>
<%= render Primer::ConditionalWrapper.new(condition: tooltip.present?, tag: :div, display: (:block if @block), classes: "Button-withTooltip") do -%>
<%= render Primer::Beta::BaseButton.new(**@system_arguments) do -%>
<span class="<%= @align_content_classes %>">
<% if leading_visual %>
Expand Down
3 changes: 2 additions & 1 deletion app/components/primer/beta/button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def initialize(
**system_arguments
)
@scheme = scheme
@block = block

@system_arguments = system_arguments

Expand All @@ -162,7 +163,7 @@ def initialize(
SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_OPTIONS, scheme, DEFAULT_SCHEME)],
SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)],
"Button",
"Button--fullWidth" => block
"Button--fullWidth" => @block
)
end

Expand Down
20 changes: 8 additions & 12 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

204 changes: 102 additions & 102 deletions docs/src/@primer/gatsby-theme-doctocat/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,108 +15,108 @@
url: "/status"
- title: Components
children:
- title: AutoComplete
url: '/components/beta/autocomplete'
- title: AutoCompleteItem
url: '/components/beta/autocompleteitem'
- title: Avatar
url: '/components/beta/avatar'
- title: AvatarStack
url: '/components/beta/avatarstack'
- title: Banner
url: '/components/alpha/banner'
- title: Blankslate
url: '/components/beta/blankslate'
- title: BorderBox
url: '/components/beta/borderbox'
- title: Box
url: '/components/box'
- title: Breadcrumbs
url: '/components/beta/breadcrumbs'
- title: Button
url: '/components/beta/button'
- title: ButtonGroup
url: '/components/beta/buttongroup'
- title: ButtonMarketing
url: '/components/alpha/buttonmarketing'
- title: ClipboardCopy
url: '/components/beta/clipboardcopy'
- title: CloseButton
url: '/components/beta/closebutton'
- title: Counter
url: '/components/beta/counter'
- title: Details
url: '/components/beta/details'
- title: Dialog
url: '/components/alpha/dialog'
- title: Dropdown
url: '/components/alpha/dropdown'
- title: Flash
url: '/components/beta/flash'
- title: Heading
url: '/components/beta/heading'
- title: HiddenTextExpander
url: '/components/alpha/hiddentextexpander'
- title: IconButton
url: '/components/beta/iconbutton'
- title: Image
url: '/components/alpha/image'
- title: ImageCrop
url: '/components/alpha/imagecrop'
- title: Label
url: '/components/beta/label'
- title: Layout
url: '/components/alpha/layout'
- title: Link
url: '/components/beta/link'
- title: Markdown
url: '/components/beta/markdown'
- title: Menu
url: '/components/alpha/menu'
- title: NavList
url: '/components/alpha/navlist'
- title: Octicon
url: '/components/beta/octicon'
- title: OcticonSymbols
url: '/components/alpha/octiconsymbols'
- title: Overlay
url: '/components/alpha/overlay'
- title: Popover
url: '/components/beta/popover'
- title: ProgressBar
url: '/components/beta/progressbar'
- title: RelativeTime
url: '/components/beta/relativetime'
- title: SegmentedControl
url: '/components/alpha/segmentedcontrol'
- title: Spinner
url: '/components/beta/spinner'
- title: State
url: '/components/beta/state'
- title: Subhead
url: '/components/beta/subhead'
- title: TabContainer
url: '/components/alpha/tabcontainer'
- title: TabNav
url: '/components/alpha/tabnav'
- title: TabPanels
url: '/components/alpha/tabpanels'
- title: Text
url: '/components/beta/text'
- title: TextField
url: '/components/alpha/textfield'
- title: TimelineItem
url: '/components/beta/timelineitem'
- title: ToggleSwitch
url: '/components/alpha/toggleswitch'
- title: Tooltip
url: '/components/alpha/tooltip'
- title: Truncate
url: '/components/beta/truncate'
- title: UnderlineNav
url: '/components/alpha/underlinenav'
- title: UnderlinePanels
url: '/components/alpha/underlinepanels'
- title: AutoComplete
url: "/components/beta/autocomplete"
- title: AutoCompleteItem
url: "/components/beta/autocompleteitem"
- title: Avatar
url: "/components/beta/avatar"
- title: AvatarStack
url: "/components/beta/avatarstack"
- title: Banner
url: "/components/alpha/banner"
- title: Blankslate
url: "/components/beta/blankslate"
- title: BorderBox
url: "/components/beta/borderbox"
- title: Box
url: "/components/box"
- title: Breadcrumbs
url: "/components/beta/breadcrumbs"
- title: Button
url: "/components/beta/button"
- title: ButtonGroup
url: "/components/beta/buttongroup"
- title: ButtonMarketing
url: "/components/alpha/buttonmarketing"
- title: ClipboardCopy
url: "/components/beta/clipboardcopy"
- title: CloseButton
url: "/components/beta/closebutton"
- title: Counter
url: "/components/beta/counter"
- title: Details
url: "/components/beta/details"
- title: Dialog
url: "/components/alpha/dialog"
- title: Dropdown
url: "/components/alpha/dropdown"
- title: Flash
url: "/components/beta/flash"
- title: Heading
url: "/components/beta/heading"
- title: HiddenTextExpander
url: "/components/alpha/hiddentextexpander"
- title: IconButton
url: "/components/beta/iconbutton"
- title: Image
url: "/components/alpha/image"
- title: ImageCrop
url: "/components/alpha/imagecrop"
- title: Label
url: "/components/beta/label"
- title: Layout
url: "/components/alpha/layout"
- title: Link
url: "/components/beta/link"
- title: Markdown
url: "/components/beta/markdown"
- title: Menu
url: "/components/alpha/menu"
- title: NavList
url: "/components/alpha/navlist"
- title: Octicon
url: "/components/beta/octicon"
- title: OcticonSymbols
url: "/components/alpha/octiconsymbols"
- title: Overlay
url: "/components/alpha/overlay"
- title: Popover
url: "/components/beta/popover"
- title: ProgressBar
url: "/components/beta/progressbar"
- title: RelativeTime
url: "/components/beta/relativetime"
- title: SegmentedControl
url: "/components/alpha/segmentedcontrol"
- title: Spinner
url: "/components/beta/spinner"
- title: State
url: "/components/beta/state"
- title: Subhead
url: "/components/beta/subhead"
- title: TabContainer
url: "/components/alpha/tabcontainer"
- title: TabNav
url: "/components/alpha/tabnav"
- title: TabPanels
url: "/components/alpha/tabpanels"
- title: Text
url: "/components/beta/text"
- title: TextField
url: "/components/alpha/textfield"
- title: TimelineItem
url: "/components/beta/timelineitem"
- title: ToggleSwitch
url: "/components/alpha/toggleswitch"
- title: Tooltip
url: "/components/alpha/tooltip"
- title: Truncate
url: "/components/beta/truncate"
- title: UnderlineNav
url: "/components/alpha/underlinenav"
- title: UnderlinePanels
url: "/components/alpha/underlinepanels"
- title: Deprecated Components
children:
- title: BlankslateComponent
Expand Down

0 comments on commit a909eae

Please sign in to comment.