Skip to content

Commit c7e8ffc

Browse files
committed
fix: Cannot add control from Controls menu with click
- We were defaulting the value to `null` instead of `undefined` - A golden-layout refactor explicitly checked for `undefined` instead of `null` - For some reason the type error in `FilterPlugin` and also `AppMainContainer` wasn't throwing an error when building?? Will need to investigate why not - Loosen restriction to just be `!= null` instead of `!== undefined` as that is the intent
1 parent d1ce140 commit c7e8ffc

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

packages/code-studio/src/main/AppMainContainer.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,7 @@ export class AppMainContainer extends Component<
379379
this.setState({ isSettingsMenuShown: true });
380380
}
381381

382-
handleControlSelect(
383-
type: string,
384-
dragEvent: KeyboardEvent | null = null
385-
): void {
382+
handleControlSelect(type: string, dragEvent?: KeyboardEvent): void {
386383
log.debug('handleControlSelect', type);
387384

388385
switch (type) {

packages/dashboard-core-plugins/src/FilterPlugin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function FilterPlugin(props: FilterPluginProps): JSX.Element | null {
176176
id = shortid.generate(),
177177
focusElement = LayoutUtils.DEFAULT_FOCUS_SELECTOR,
178178
createNewStack = false,
179-
dragEvent = null,
179+
dragEvent = undefined,
180180
}) => {
181181
const config = {
182182
type: 'react-component' as const,

packages/dashboard/src/layout/LayoutUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ class LayoutUtils {
478478
config.id = shortid.generate();
479479
}
480480

481-
if (dragEvent !== undefined) {
481+
if (dragEvent != null) {
482482
root?.layoutManager.createDragSourceFromEvent(config, dragEvent);
483483
return;
484484
}

0 commit comments

Comments
 (0)