Fix focus to match portal (#56)

This commit is contained in:
Laurent Nguyen 2020-06-26 16:52:28 +02:00 committed by GitHub
parent e5fc6f2022
commit 1d3b672a14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 11 deletions

View File

@ -54,6 +54,8 @@
@SelectionColor: #3074B0; @SelectionColor: #3074B0;
@FocusColor: #00bcf2;
/****************************************************************************** /******************************************************************************
METRICS METRICS
/******************************************************************************/ /******************************************************************************/
@ -198,7 +200,7 @@
} }
.focus() { .focus() {
outline: 1px dashed @AccentMedium; outline: 1px dashed @FocusColor;
} }
/************************************************************************************************ /************************************************************************************************

View File

@ -14,6 +14,10 @@ body {
font-family: @DataExplorerFont; font-family: @DataExplorerFont;
font-size: 12px; font-size: 12px;
height: 100%; height: 100%;
:focus {
.focus()
}
} }
.float-right { .float-right {
@ -174,7 +178,7 @@ body {
&:active { &:active {
.active(); .active();
} }
&:focus .urlTokenCopyTooltiptext, &:focus .urlTokenCopyTooltiptext { &:focus .urlTokenCopyTooltiptext, &:focus .urlTokenCopyTooltiptext {
.tooltipVisible(); .tooltipVisible();
} }
@ -362,7 +366,7 @@ body {
} }
.splashLoaderContainer { .splashLoaderContainer {
z-index: 5; z-index: 5;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
@ -1449,7 +1453,7 @@ p {
.throughputModeRadio { .throughputModeRadio {
vertical-align: text-bottom; vertical-align: text-bottom;
} }
.nonFirstRadio { .nonFirstRadio {
margin-left: @LargeSpace; margin-left: @LargeSpace;
} }
@ -1484,7 +1488,7 @@ p {
.largePartitionKeyDescription { .largePartitionKeyDescription {
margin: @DefaultSpace 0px 0px; margin: @DefaultSpace 0px 0px;
} }
} }
.enableAnalyticalStorage { .enableAnalyticalStorage {
@ -2216,13 +2220,13 @@ a:link {
.documentsGridHeaderContainer table thead tr { .documentsGridHeaderContainer table thead tr {
position: sticky; position: sticky;
top: 0; top: 0;
th { th {
position: sticky; position: sticky;
top: 0; top: 0;
background-color: #fff !important; background-color: #fff !important;
border-bottom: 1px solid #CCCCCC !important; border-bottom: 1px solid #CCCCCC !important;
} }
} }
.documentsGridHeader { .documentsGridHeader {

View File

@ -133,7 +133,7 @@ export const FeaturePanelComponent: React.FunctionComponent = () => {
.find(f => f.key === "feature.notebookserverurl") .find(f => f.key === "feature.notebookserverurl")
.reactState[1]("https://localhost:10001/12345/notebook/"); .reactState[1]("https://localhost:10001/12345/notebook/");
stringFeatures.find(f => f.key === "feature.notebookservertoken").reactState[1]("token"); stringFeatures.find(f => f.key === "feature.notebookservertoken").reactState[1]("token");
stringFeatures.find(f => f.key === "feature.notebookbasepath").reactState[1]("."); stringFeatures.find(f => f.key === "feature.notebookbasepath").reactState[1]("./notebooks");
setPlatform(platformOptions.find(o => o.key === "Hosted")); setPlatform(platformOptions.find(o => o.key === "Hosted"));
}; };

View File

@ -6,10 +6,9 @@
*/ */
import * as React from "react"; import * as React from "react";
import * as ReactDOM from "react-dom";
import * as Constants from "../../../Common/Constants"; import * as Constants from "../../../Common/Constants";
import AnimateHeight from "react-animate-height"; import AnimateHeight from "react-animate-height";
import { IconButton } from "office-ui-fabric-react/lib/Button"; import { IconButton, IButtonStyles } from "office-ui-fabric-react/lib/Button";
import { import {
DirectionalHint, DirectionalHint,
IContextualMenuItemProps, IContextualMenuItemProps,
@ -227,6 +226,10 @@ export class TreeNodeComponent extends React.Component<TreeNodeComponentProps, T
private renderContextMenuButton(node: TreeNode): JSX.Element { private renderContextMenuButton(node: TreeNode): JSX.Element {
const menuItemLabel = "More"; const menuItemLabel = "More";
const buttonStyles: Partial<IButtonStyles> = {
rootFocused: { outline: `1px dashed ${Constants.StyleConstants.FocusColor}` }
};
return ( return (
<div ref={this.contextMenuRef} onContextMenu={this.onRightClick} onKeyPress={this.onMoreButtonKeyPress}> <div ref={this.contextMenuRef} onContextMenu={this.onRightClick} onKeyPress={this.onMoreButtonKeyPress}>
<IconButton <IconButton
@ -264,6 +267,7 @@ export class TreeNodeComponent extends React.Component<TreeNodeComponentProps, T
onRenderIcon: (props: any) => <img src={menuItem.iconSrc} alt="" /> onRenderIcon: (props: any) => <img src={menuItem.iconSrc} alt="" />
})) }))
}} }}
styles={buttonStyles}
/> />
</div> </div>
); );

View File

@ -191,6 +191,13 @@ exports[`TreeNodeComponent renders a simple node (sorted children, expanded) 1`]
} }
} }
name="More" name="More"
styles={
Object {
"rootFocused": Object {
"outline": "1px dashed undefined",
},
}
}
/> />
</div> </div>
</div> </div>
@ -314,6 +321,13 @@ exports[`TreeNodeComponent renders sorted children, expanded, leaves and parents
} }
} }
name="More" name="More"
styles={
Object {
"rootFocused": Object {
"outline": "1px dashed undefined",
},
}
}
/> />
</div> </div>
</div> </div>