Skip to content

Commit 078fcf0

Browse files
authored
fix: disable-child-interaction going over edges + other details (#251)
* fix disable-child-interaction going over edges * only show oultine when using keyboard navigation * use new color system
1 parent bd6fa5f commit 078fcf0

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

packages/uui-css/lib/uui-text.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@
104104

105105
.uui-text a:link,
106106
.uui-text a:active {
107-
color: var(--uui-color-space-cadet);
107+
color: var(--uui-color-interactive);
108108
}
109109
.uui-text a:hover {
110-
color: var(--uui-color-violet-blue);
110+
color: var(--uui-color-interactive-emphasis);
111111
}
112112

113113
.uui-text small {

packages/uui-table/lib/uui-table-cell.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class UUITableCellElement extends LitElement {
1414
static styles = [
1515
css`
1616
:host {
17+
position: relative;
1718
display: table-cell;
1819
height: var(--uui-table-cell-height, var(--uui-size-12));
1920
padding: var(

packages/uui-table/lib/uui-table-row.element.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,47 @@ export class UUITableRowElement extends SelectOnlyMixin(
2323
:host {
2424
display: table-row;
2525
position: relative;
26+
outline-offset: -3px;
2627
}
2728
2829
:host([selectable]) {
2930
cursor: pointer;
3031
}
3132
33+
:host(:focus) {
34+
outline: calc(2px * var(--uui-show-focus-outline, 1)) solid
35+
var(--uui-color-focus);
36+
}
3237
:host([selected]) {
3338
outline: 2px solid
3439
var(--uui-table-row-color-selected, var(--uui-color-selected));
35-
outline-offset: -3px;
3640
}
37-
38-
:host(:focus) {
41+
:host([selected]:focus) {
3942
outline-color: var(--uui-color-focus);
4043
}
4144
`,
4245
];
4346

47+
constructor() {
48+
super();
49+
50+
// hide outline if mouse-interaction:
51+
let hadMouseDown = false;
52+
this.addEventListener('blur', () => {
53+
if (hadMouseDown === false) {
54+
this.style.setProperty('--uui-show-focus-outline', '1');
55+
}
56+
hadMouseDown = false;
57+
});
58+
this.addEventListener('mousedown', () => {
59+
this.style.setProperty('--uui-show-focus-outline', '0');
60+
hadMouseDown = true;
61+
});
62+
this.addEventListener('mouseup', () => {
63+
hadMouseDown = false;
64+
});
65+
}
66+
4467
connectedCallback() {
4568
super.connectedCallback();
4669
this.setAttribute('role', 'row');

0 commit comments

Comments
 (0)