Skip to content

nouislider: fixed rendering in higher angular version#319

Open
Joostluijben wants to merge 1 commit intosurveyjs:masterfrom
Joostluijben:nouislider-fix
Open

nouislider: fixed rendering in higher angular version#319
Joostluijben wants to merge 1 commit intosurveyjs:masterfrom
Joostluijben:nouislider-fix

Conversation

@Joostluijben
Copy link
Copy Markdown

The nouislider component was not rendering for me. After adding the source code found from here as a custom component and changing these lines it was rendering for me.

Screenshot from 2022-11-08 01-36-47

Using
angular version 18.3.9
node version: 16.8.1
typescript: 4.4.2
npm: 8.19.2

@Joostluijben Joostluijben changed the title Removed some lines and change the way of export to fix the nouislider rendering nouislider: fixed rendering in higher angular version Nov 8, 2022
Comment thread src/nouislider.js
});
question.updateSliderProperties = function () {
const elems = document.getElementsByClassName("noUi-pips");
if (elems.length > 0) elems[elems.length - 1].style.display = "none";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to remove this (and below) line?

Comment thread src/nouislider.js
Survey.CustomWidgetCollection.Instance.addCustomWidget(widget, "customtype");
}

if (typeof Survey !== "undefined") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove this call, custom widget will not be registered in non-modular applications

Comment thread src/nouislider.js
init(Survey);
}

export default init;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the "default" export cause problems with higher Angular versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants