Skip to content

Commit

Permalink
Merge pull request #772 from missive/fix/width-on-hover
Browse files Browse the repository at this point in the history
Fix picker width changing when hovering emojis
  • Loading branch information
EtienneLem committed Jan 12, 2023
2 parents 465eec0 + 9302f95 commit b3544a6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/emoji-mart/src/components/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1099,10 +1099,17 @@ export default class Picker extends Component {
}

render() {
const lineWidth = this.props.perLine * this.props.emojiButtonSize

return (
<section
id="root"
class="flex flex-column"
style={{
width: this.props.dynamicWidth
? '100%'
: `calc(${lineWidth}px + (var(--padding) + var(--sidebar-width)))`,
}}
data-emoji-set={this.props.set}
data-theme={this.state.theme}
data-menu={this.state.showSkins ? '' : undefined}
Expand All @@ -1116,9 +1123,7 @@ export default class Picker extends Component {
<div ref={this.refs.scroll} class="scroll flex-grow padding-lr">
<div
style={{
width: this.props.dynamicWidth
? '100%'
: this.props.perLine * this.props.emojiButtonSize,
width: this.props.dynamicWidth ? '100%' : lineWidth,
height: '100%',
}}
>
Expand Down

0 comments on commit b3544a6

Please sign in to comment.