Skip to content

Commit ac5cf17

Browse files
EugeneElkinignatvilesov
authored andcommitted
Scrolling auto position issue in Edge was fixes (#43)
* Scrolling auto position issue in Edge was fixes
1 parent 5843bca commit ac5cf17

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.8.1
2+
* FIX: auto scrolling focus for selected period didn't work in Edge and broke the layout
3+
14
## 1.8.0
25
* Added localization for all supported languages
36

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-visuals-timeline",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "Timeline slicer is a graphical date range selector used as a filtering component in the report canvas",
55
"repository": {
66
"type": "git",

pbiviz.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Timeline",
55
"guid": "Timeline1447991079100",
66
"visualClassName": "Timeline",
7-
"version": "1.8.0",
7+
"version": "1.8.1",
88
"description": "Timeline slicer is a graphical date range selector used as a filtering component in the report canvas",
99
"supportUrl": "http://community.powerbi.com",
1010
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-timeline"

src/visual.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,14 @@ module powerbi.extensibility.visual {
246246
private localizationManager: ILocalizationManager;
247247
private horizontalAutoScrollingPositionOffset: number = 200;
248248

249+
private selectedGranulaPos: number = null;
250+
251+
private scrollAutoFocusFunc = (selectedGranulaPos: number) => {
252+
if (selectedGranulaPos) {
253+
(this.mainSvgWrapperSelection[0][0] as any).scrollLeft = selectedGranulaPos - this.horizontalAutoScrollingPositionOffset;
254+
}
255+
}
256+
249257
/**
250258
* Changes the current granularity depending on the given granularity type
251259
* Separates the new granularity's date periods which contain the start/end selection
@@ -1130,6 +1138,8 @@ module powerbi.extensibility.visual {
11301138
timelineData,
11311139
timelineProperties.cellHeight,
11321140
timelineProperties.cellsYPosition);
1141+
1142+
this.scrollAutoFocusFunc(this.selectedGranulaPos);
11331143
}
11341144

11351145
private renderLabels(
@@ -1294,7 +1304,7 @@ module powerbi.extensibility.visual {
12941304

12951305
if (visSettings.scrollAutoAdjustment.show && isSelected && !singleCaseDone) {
12961306
const selectedGranulaPos: number = (cellSelection[0][index] as any).x.baseVal.value;
1297-
(this.mainSvgWrapperSelection[0][0] as any).scrollTo(selectedGranulaPos - this.horizontalAutoScrollingPositionOffset, 0);
1307+
this.selectedGranulaPos = selectedGranulaPos;
12981308
singleCaseDone = true;
12991309
}
13001310

0 commit comments

Comments
 (0)