Include scrollbar width in total picker width
parent
522b74f0a7
commit
385408b51c
|
@ -16,6 +16,7 @@ module.exports = {
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
include: [
|
include: [
|
||||||
path.resolve('src'),
|
path.resolve('src'),
|
||||||
|
path.resolve('node_modules/measure-scrollbar'),
|
||||||
path.resolve('data'),
|
path.resolve('data'),
|
||||||
path.resolve('example'),
|
path.resolve('example'),
|
||||||
],
|
],
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
"url": "https://github.com/missive/emoji-mart/issues"
|
"url": "https://github.com/missive/emoji-mart/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/missive/emoji-mart",
|
"homepage": "https://github.com/missive/emoji-mart",
|
||||||
"dependencies": {},
|
"dependencies": {
|
||||||
|
"measure-scrollbar": "^0.1.0"
|
||||||
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^0.14.0 || ^15.0.0-0"
|
"react": "^0.14.0 || ^15.0.0-0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,7 @@ import '../vendor/raf-polyfill'
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
import measureScrollbar from 'measure-scrollbar'
|
||||||
import data from '../../data'
|
import data from '../../data'
|
||||||
|
|
||||||
import store from '../utils/store'
|
import store from '../utils/store'
|
||||||
|
@ -328,7 +329,7 @@ export default class Picker extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
var { perLine, emojiSize, set, sheetSize, style, title, emoji, color, native, backgroundImageFn, emojisToShowFilter, include, exclude, autoFocus } = this.props,
|
var { perLine, emojiSize, set, sheetSize, style, title, emoji, color, native, backgroundImageFn, emojisToShowFilter, include, exclude, autoFocus } = this.props,
|
||||||
{ skin } = this.state,
|
{ skin } = this.state,
|
||||||
width = (perLine * (emojiSize + 12)) + 12 + 2
|
width = (perLine * (emojiSize + 12)) + 12 + 2 + measureScrollbar()
|
||||||
|
|
||||||
return <div style={{width: width, ...style}} className='emoji-mart'>
|
return <div style={{width: width, ...style}} className='emoji-mart'>
|
||||||
<div className='emoji-mart-bar'>
|
<div className='emoji-mart-bar'>
|
||||||
|
|
|
@ -30,6 +30,7 @@ module.exports = {
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
include: [
|
include: [
|
||||||
path.resolve('src'),
|
path.resolve('src'),
|
||||||
|
path.resolve('node_modules/measure-scrollbar'),
|
||||||
path.resolve('data'),
|
path.resolve('data'),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -1712,6 +1712,10 @@ lru-cache@2.2.x:
|
||||||
version "2.2.4"
|
version "2.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d"
|
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d"
|
||||||
|
|
||||||
|
measure-scrollbar@^0.1.0:
|
||||||
|
version "0.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/measure-scrollbar/-/measure-scrollbar-0.1.0.tgz#2bbfac6773bcbb98d814e6890554c0b92846fe6f"
|
||||||
|
|
||||||
media-typer@0.3.0:
|
media-typer@0.3.0:
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
||||||
|
|
Loading…
Reference in New Issue