Skip to content

Commit 3669cb7

Browse files
author
Michael Mrowetz
committed
#188 fix cross browser tabing
1 parent 2bf411e commit 3669cb7

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

src/ts/waterfall/details-overlay/overlay-manager.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ class OverlayManager implements OverlayManagerClass {
138138
/** shared variable to keep track of heigth */
139139
let currY = 0;
140140
let updateHeight = (overlay, y, currHeight) => {
141-
// console.log(currY, currHeight);
142141
currY += currHeight;
143142
overlay.actualY = y;
144143
overlay.height = currHeight;
@@ -159,7 +158,7 @@ class OverlayManager implements OverlayManagerClass {
159158
overlayHolder.appendChild(infoOverlay);
160159
updateHeight(overlay, y, infoOverlay.getBoundingClientRect().height);
161160
};
162-
rowItems.forEach((rowItem, index) => {
161+
let updateRow = (rowItem, index) => {
163162
const overlay = find(this.openOverlays, (o) => o.index === index);
164163
const overlayEl = rowItem.nextElementSibling.firstElementChild as SVGGElement;
165164
this.realignRow(rowItem, currY);
@@ -176,15 +175,24 @@ class OverlayManager implements OverlayManagerClass {
176175
return; // not open
177176
}
178177
if (overlayEl) {
179-
updateHeight(overlay, overlay.defaultY + currY, overlay.height);
180-
const fo = overlayEl.querySelector("foreignObject");
181178
const bg = overlayEl.querySelector(".info-overlay-bg");
182-
fo.setAttribute("y", overlay.actualY.toString());
179+
const fo = overlayEl.querySelector("foreignObject");
180+
const btnRect = overlayEl.querySelector(".info-overlay-close-btn rect");
181+
const btnText = overlayEl.querySelector(".info-overlay-close-btn text");
182+
// bg.setAttribute("transform", `translate(0, ${currY})`);
183+
// btnText.setAttribute("transform", `translate(0, ${currY})`);
184+
// btnRect.setAttribute("transform", `translate(0, ${currY})`);
185+
updateHeight(overlay, overlay.defaultY + currY, overlay.height);
186+
// needs updateHeight
183187
bg.setAttribute("y", overlay.actualY.toString());
188+
fo.setAttribute("y", overlay.actualY.toString());
189+
btnText.setAttribute("y", overlay.actualY.toString());
190+
btnRect.setAttribute("y", overlay.actualY.toString());
184191
return;
185192
}
186193
addNewOverlay(rowItem.nextElementSibling as SVGGElement, overlay);
187-
});
194+
};
195+
rowItems.forEach(updateRow);
188196
}
189197
};
190198
export {

src/ts/waterfall/row/svg-row.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export function createRow(context: Context, index: number,
3131
const rowHeight = rectData.height;
3232
const leftColumnWith = context.options.leftColumnWith;
3333
let rowItem = svg.newA(entry.responseDetails.rowClass);
34-
rowItem.setAttribute("href", "javascript:void(0)");
34+
rowItem.setAttribute("tabindex", "0");
35+
rowItem.setAttribute("xlink:href", "javascript:void(0)");
3536
let leftFixedHolder = svg.newSvg("left-fixed-holder", {
3637
"width": `${leftColumnWith}%`,
3738
"x": "0",
@@ -95,8 +96,9 @@ export function createRow(context: Context, index: number,
9596
onDetailsOverlayShow(evt);
9697
});
9798
rowItem.addEventListener("keydown", (evt: KeyboardEvent) => {
98-
// on enter
99-
if (evt.which === 32) {
99+
// space on enter
100+
if (evt.which === 32 || evt.which === 13) {
101+
evt.preventDefault();
100102
return onDetailsOverlayShow(evt);
101103
}
102104

0 commit comments

Comments
 (0)