mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 05:01:14 +01:00
Only limit AutoComplete to window bounds if element is fixed.
This commit is contained in:
parent
b60d101d42
commit
e11a5a823a
2 changed files with 4 additions and 1 deletions
|
@ -12,17 +12,19 @@ class LayerSourceLayer extends React.Component {
|
|||
value: PropTypes.string,
|
||||
onChange: PropTypes.func,
|
||||
sourceLayerIds: PropTypes.array,
|
||||
isFixed: PropTypes.bool,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
onChange: () => {},
|
||||
sourceLayerIds: [],
|
||||
isFixed: false
|
||||
}
|
||||
|
||||
render() {
|
||||
return <InputBlock label={"Source Layer"} doc={styleSpec.latest.layer['source-layer'].doc}>
|
||||
<AutocompleteInput
|
||||
keepMenuWithinWindowBounds={true}
|
||||
keepMenuWithinWindowBounds={!!this.props.isFixed}
|
||||
value={this.props.value}
|
||||
onChange={this.props.onChange}
|
||||
options={this.props.sourceLayerIds.map(l => [l, l])}
|
||||
|
|
|
@ -127,6 +127,7 @@ class AddModal extends React.Component {
|
|||
}
|
||||
{this.state.type !== 'background' && this.state.type !== 'raster' &&
|
||||
<LayerSourceLayerBlock
|
||||
isFixed={true}
|
||||
sourceLayerIds={layers}
|
||||
value={this.state['source-layer']}
|
||||
onChange={v => this.setState({ 'source-layer': v })}
|
||||
|
|
Loading…
Reference in a new issue