Skip to content

Formatted text field values cleared out of angular form data when leaving a field. #2133

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

Open
claymeisman opened this issue Feb 2, 2024 · 4 comments
Assignees
Labels
20 scheduled for version 20 bug Something isn't working Stephan wants to look at it!

Comments

@claymeisman
Copy link

claymeisman commented Feb 2, 2024

Describe the bug
Open/Create a PDF with field that as the formatting option enabled, like money. There just has to be one field to break all fields.

When using the text selection tool (Hand tool is a different bug) open the pdf:

  1. Enter a value on the first field.
  2. Navigate away by pressing tab or click on the white space of the document.
  3. Review the answers sent to angular. Notice they are cleared out/not in sync?

Version info

  • Version of ngx-extended-pdf-viewer: 19.0.4

Demo PDF file
FormattedTest.pdf

@stephanrauh
Copy link
Owner

Without having looked at your bug yet: thank you so much for providing a reproducer! My gut feeling is you've reported a challenging bug, so I happily accept every help I can get!

@claymeisman
Copy link
Author

This is the fix I am doing in the mean time.
Personal fork

I went back and forth on where to put the check for the formattedValue field.
From should it be sent in the first place to accounting for it at just the place I am seeing an issue.

I opted for my specific scenario fix.

@claymeisman
Copy link
Author

Basically, there is an extra call to updateAngularFormValue being generated when there are formatted fields. And if the leaving field does not have formatting it is making that call with a null formattedValue field. So, to me that is the bug, but that is in the pdfjs code, and I was leery of modifying that cause I did not know where or how that was being made.

@claymeisman claymeisman changed the title Formatted text field values cleared out of angular form datawhen leaving a field. Formatted text field values cleared out of angular form data when leaving a field. Feb 4, 2024
@stephanrauh stephanrauh added 20 scheduled for version 20 and removed Version 19 labels Apr 13, 2024
@stephanrauh
Copy link
Owner

Maybe I solved your bug today. At the moment, I'm trying to work my way through the tickets that piled up during my vacations, so I didn't run a test yet, but it reminds me of a bug I solved with version 20.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
20 scheduled for version 20 bug Something isn't working Stephan wants to look at it!
Projects
None yet
Development

No branches or pull requests

2 participants