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

Dropdown: Input field text cannot be selected or removed when Markdown is enabled #7787

Closed
JaneSjs opened this issue Feb 1, 2024 · 0 comments · Fixed by #7805
Closed

Dropdown: Input field text cannot be selected or removed when Markdown is enabled #7787

JaneSjs opened this issue Feb 1, 2024 · 0 comments · Fixed by #7805
Assignees
Labels
usability user issue An issue or bug reported by users
Milestone

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Feb 1, 2024

T16615 - Issue with Dropdown when using Showdown library
https://surveyjs.answerdesk.io/internal/ticket/details/T16615


In the meantime, you can disable markdown formatting for Dropdown items. Use the following code:
https://plnkr.co/edit/X8KOzFxL9pDJDHux

var converter = new showdown.Converter();
function processHtml(options){
        var str = converter.makeHtml(options.text);
        str = str.substring(3);
        str = str.substring(0, str.length - 4);
        options.html = str;
}
survey.onTextMarkdown
        .add(function (survey, options) {
            //convert the markdown text to html
            if(options.element.isQuestion && options.element.getType() === "dropdown") {
                if(options.text === options.element.title || options.text === options.element.description){
                   processHtml(options);
                }
           } else {
               processHtml(options);
           }
});
@JaneSjs JaneSjs added usability user issue An issue or bug reported by users labels Feb 1, 2024
novikov82 added a commit that referenced this issue Feb 5, 2024
novikov82 added a commit that referenced this issue Feb 5, 2024
novikov82 added a commit that referenced this issue Feb 5, 2024
novikov82 added a commit that referenced this issue Feb 5, 2024
tsv2013 pushed a commit that referenced this issue Feb 6, 2024
…wn is enabled (#7805)

* #7787 Dropdown text cannot be selected/removed by symbols when Markdown is enabled
Fixes #7787

* #7787 - fixed tests

* #7787 update screenshots

* #7787 - update screenshots
@RomanTsukanov RomanTsukanov changed the title Dropdown text cannot be selected/removed by symbols when Markdown is enabled Dropdown: Input field text cannot be selected or removed when Markdown is enabled Feb 6, 2024
@OlgaLarina OlgaLarina removed their assignment Feb 6, 2024
@OlgaLarina OlgaLarina added this to the v1.9.129 milestone Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability user issue An issue or bug reported by users
Projects
None yet
3 participants