Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
There is currently a bug with the Signature Field widget where the value gets
cleared when the screen is resized.
This is problematic anytime someone wants to resize the browser or if they
rotate a mobile device.
Steps to reproduce
- Go to an entity form which contains a Signature field.
- Draw anything in the Signature field.
- Resize the browser.
Proposed resolution
Instead of clearing the Signature when the browser is resized, re-build the Signature value.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#4 | signaturefield-3292082-4.patch | 1.2 KB | Matthijs |
Comments
Comment #2
mdolnik CreditAttribution: mdolnik as a volunteer and commentedComment #3
mdolnik CreditAttribution: mdolnik as a volunteer and commentedComment #4
MatthijsThanks for reporting. This isn't a bug, but a requirement do deal with HiDPI screens, see https://github.com/szimek/signature_pad#handling-high-dpi-screens
But your changes are mentioned as a workaround, so this should work... I did update the patch a bit, could you please give it a try?
I also removed the
valueElement.val(value);
call, not sure why I added it in the first place, but it looks redundant.Comment #5
mdolnik CreditAttribution: mdolnik as a volunteer and commentedI figured it wasn't a necessarily a bug, but wasn't sure what the reasoning was, thanks for the link. Regardless from the user point of view having their signature disappear would appear as a bug to them.
Your changes seem to work fine on my end, no issue with the changes.
Comment #7
MatthijsPatch applied and committed.