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

Fix unexpected click handling in File Explorer #255

Merged
merged 9 commits into from
Oct 28, 2021
1 change: 1 addition & 0 deletions packages/dashboard-core-plugins/src/ConsolePlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export const ConsolePlugin = ({
return {
type: 'react-component',
component: NotebookPanel.COMPONENT,
isFocusOnShow: false,
props: {
localDashboardId: id,
metadata: { id: panelId },
Expand Down
2 changes: 2 additions & 0 deletions packages/dashboard/src/layout/LayoutUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class LayoutUtils {
if (!isCorrectType) {
parent.removeChild(child, true);
parent.addChild({ type });

// TODO: This is changing the fous to the body for some reason. Why???
mofojed marked this conversation as resolved.
Show resolved Hide resolved
parent.contentItems[0].addChild(child);
}

Expand Down
8 changes: 5 additions & 3 deletions packages/golden-layout/src/js/items/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ lm.utils.copy(lm.items.Component.prototype, {

_$show: function () {
this.container.show();
// focus the shown container element on show
// preventScroll isn't supported in safari, but also doesn't matter for illumon when 100% window
this.container._contentElement[0].focus({ preventScroll: true });
if (this.container._config.isFocusOnShow ?? true) {
// focus the shown container element on show
// preventScroll isn't supported in safari, but also doesn't matter for illumon when 100% window
this.container._contentElement[0].focus({ preventScroll: true });
}
lm.items.AbstractContentItem.prototype._$show.call(this);
},

Expand Down