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

Slider not initialized correctly #1592

Closed
shaman-apprentice opened this issue Dec 15, 2020 · 5 comments · Fixed by #1897
Closed

Slider not initialized correctly #1592

shaman-apprentice opened this issue Dec 15, 2020 · 5 comments · Fixed by #1897
Assignees
Labels
bug Only issues that describe bugs. javascript Pull requests that update Javascript code. Usually created by Dependabot. priority:low Set by PO

Comments

@shaman-apprentice
Copy link
Contributor

shaman-apprentice commented Dec 15, 2020

Bug

Expected Behavior

WHEN I open the map and its color option

THEN the slider is initialized correctly

Actual Behavior

Sometimes (most often in small maps) the max slider is on the min slider

Screenshots

image

Steps to Reproduce the Problem

Most often can be seen in local developed chrome with standard small sample1.cc.json

Specifications

  • is released in online-demo: yes
  • CodeCharta Version: 1.6.4
  • OS: Windows
  • Browser: Chrome
@shaman-apprentice shaman-apprentice added the bug Only issues that describe bugs. label Dec 15, 2020
@shaman-apprentice
Copy link
Contributor Author

Dev notes: https://github.com/angular-slider/angularjs-slider#common-issues looks kind of related and the following code does indeed fix it. But we should come up with a better solution than the hardcoded timeout.

rangeSlider.component.ts:

	$postLink() {
		this.$timeout(() => {
			this.$scope.$broadcast('rzSliderForceRender')
		}, 3000);
	}

@BridgeAR
Copy link
Member

@shaman-apprentice it's described as a single millisecond timeout in the module. Does that suffice as well?

@shaman-apprentice
Copy link
Contributor Author

@BridgeAR it is described as a millisecond timeout after it has become visible. In the current implementation the slider doesn't know when it becomes visible. So it might be enough to integrate that in an onOpen method somewhere.

@shaman-apprentice
Copy link
Contributor Author

What also makes me wonder is, that the timeout 3000 worked, even if the slider has not become visible in the meantime. So I am not sure, where the race condition is, but at some point firing this.$scope.$broadcast('rzSliderForceRender') will probably fix it.

@BridgeAR
Copy link
Member

If I am not mistaken, it's possible to determine when the parent becomes visible (due to e.g., listening to the correct event or triggering a JS function on show)?

@BridgeAR BridgeAR added priority:low Set by PO javascript Pull requests that update Javascript code. Usually created by Dependabot. labels Feb 26, 2021
Christian-Eberhard pushed a commit that referenced this issue Apr 14, 2021
RomanenkoVladimir added a commit that referenced this issue Apr 16, 2021
* Removes unused whitespaces in the searchbar,
Removes the usage of ids as selectors,
Adds semi responsiveness for the metric cards #1037

* Updates changelog #1592

* Fix linting

* Update Changelog

Co-authored-by: ChristianE <christian.eberhard@maibornwolff.de>
Co-authored-by: RomanenkoVladimir <volodymyr.romanenko@icloud.com>
Christian-Eberhard pushed a commit that referenced this issue May 11, 2021
Christian-Eberhard pushed a commit that referenced this issue May 25, 2021
RomanenkoVladimir added a commit that referenced this issue May 28, 2021
* Adds a forced render of the slider after document is ready #1592

* Adds testing for rendering the slider #1592

* Adds a comment and a reminder to the solution #1592

* Fixes prettier finds

#1592

* Fixes flaky test #1592

* Updates tests to ensure higher coverage #1592

Co-authored-by: ChristianE <christian.eberhard@maibornwolff.de>
Co-authored-by: RomanenkoVladimir <volodymyr.romanenko@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Only issues that describe bugs. javascript Pull requests that update Javascript code. Usually created by Dependabot. priority:low Set by PO
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants