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

Introduce an option to reset the Bold text style for Question and Matrix column Titles #357

Open
JaneSjs opened this issue Dec 2, 2024 · 1 comment
Labels
enhancement New feature or request user issue An issue or bug reported by users. v2.0+

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Dec 2, 2024

It is possible to use the onRenderQuestion function to manipulate title bricks and remove the Bold text style.

surveyPDF.onRenderQuestion.add(function (survey, options) {
    if (!!options.question.resetBoldTitle) {
      const titleBrick = options.bricks[0].bricks[0];
      const titleBricks = titleBrick.unfold();
      const titleString = titleBricks.reduce((a, b) => a + b.text, "");
      const point = options.module.SurveyHelper.createPoint(
        titleBrick,
        true,
        true
      );
      options.bricks[0].bricks[0] =
        options.module.SurveyHelper.createPlainTextFlat(
          point,
          options.question,
          options.controller,
          titleString,
          options.module.TextBrick
        );
    }
});

However, this code produces the following issues:

  • A gap remains after a multi-line question title since the overall title height is decreased;
  • This code doesn't work when titleLocation: "left"
@JaneSjs JaneSjs added enhancement New feature or request user issue An issue or bug reported by users. v2.0+ labels Dec 2, 2024
@JaneSjs JaneSjs changed the title Introduce an option to reset a Bold question title Introduce an option to reset the Bold text style for Question and Matrix column Titles Dec 9, 2024
@JaneSjs
Copy link
Contributor Author

JaneSjs commented Dec 9, 2024

T21006 - Reset the Bold text style for Matrix Column Titles
https://surveyjs.answerdesk.io/internal/ticket/details/T21006

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user issue An issue or bug reported by users. v2.0+
Projects
None yet
Development

No branches or pull requests

1 participant