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

Hide date widget fake input when rendering pdf #211

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/enketo-core/src/widget/text-print/text-print.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ class TextPrintWidget extends Widget {
this.element.after(printElement);
this.element.classList.add('print-hide');

// If previous element is a fake input in date widget, hide it as well
const previousElement = this.element.previousElementSibling;
if (
previousElement !== null &&
previousElement.classList.contains('date')
) {
previousElement.classList.add('print-hide');
}

this.widget = this.element.parentElement.querySelector(
`.${className}`
);
Expand Down
Loading