Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend select menu outside of panel, allow top placement #1056

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/editor/components/components/AddGeneratorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ export default class AddGeneratorComponent extends React.Component {
noOptionsMessage={() => 'No components found'}
onChange={this.addComponent}
value={this.state.value}
menuPosition="fixed"
menuPlacement="auto"
minMenuHeight={300}
/>
</div>
);
Expand Down
28 changes: 28 additions & 0 deletions src/editor/components/components/StreetSegmentSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import PropTypes from 'prop-types';
import Component from './StreetSegmentComponent';
import PropertyRow from './PropertyRow';
import { StreetSurfaceIcon } from '../../icons';
import {
cloneEntity,
removeSelectedEntity,
renameEntity
} from '../../lib/entity';
import { Button } from '../components';

// Define featured component prefixes that should be shown in their own section
const FEATURED_COMPONENT_PREFIXES = ['street-generated-'];
Expand Down Expand Up @@ -55,6 +61,28 @@ const StreetSegmentSidebar = ({ entity }) => {
isSingle={false}
entity={entity}
/>
<div className="sidepanelContent">
<div id="sidebar-buttons" className="pb-2">
<Button
variant={'toolbtn'}
onClick={() => renameEntity(entity)}
>
Rename
</Button>
<Button
variant={'toolbtn'}
onClick={() => cloneEntity(entity)}
>
Duplicate
</Button>
<Button
variant={'toolbtn'}
onClick={() => removeSelectedEntity()}
>
Delete
</Button>
</div>
</div>
{/* props for street-segment but formatted as a fake 'surface' component */}
<div className="collapsible component">
<div className="static">
Expand Down
6 changes: 6 additions & 0 deletions src/editor/components/widgets/Mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ export default class Mixin extends React.Component {
noOptionsMessage={() => 'No mixins found'}
onChange={this.updateMixins.bind(this)}
value={this.state.mixins}
menuPosition="fixed"
menuPlacement="auto"
minMenuHeight={300}
/>
) : (
<Select
Expand All @@ -169,6 +172,9 @@ export default class Mixin extends React.Component {
noOptionsMessage={() => 'No models found'}
onChange={this.updateMixinSingle.bind(this)}
value={this.state.mixins}
menuPosition="fixed"
menuPlacement="auto"
minMenuHeight={300}
/>
)}
</span>
Expand Down
3 changes: 3 additions & 0 deletions src/editor/components/widgets/ModelsArrayWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export default class ModelsArrayWidget extends React.Component {
onChange={this.updateModels.bind(this)}
simpleValue
value={this.state.modelsArrayWidget}
menuPosition="fixed"
menuPlacement="auto"
minMenuHeight={300}
/>
</span>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/editor/components/widgets/SelectWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export default class SelectWidget extends React.Component {
value={this.state.value}
noOptionsMessage={() => 'No value found'}
onChange={this.onChange}
menuPosition="fixed"
menuPlacement="auto"
minMenuHeight={300}
/>
);
}
Expand Down
Loading