Problem/Motivation

Currently, the Signature element doesn't support Webform Conditions or ajax value change events.

Steps to reproduce

1. Create a new webform, add a Signature element and a Text field element

2. Make the Text field Visible condition depend on wether the Signature element is filled or empty

3. The condition doesn't work (neither do ajax events, etc.)

Proposed resolution

Trigger the change event when updating the associated input field value on webform.element.signature.js line 56.

Remaining tasks

I'm attaching a .patch that works on webform v6.2.9.

It if it's appropriate perhaps make the change in the dev branch of webform.

Issue fork webform-3533744

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

apparatchik created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs work

Please create an MR for webform 6.3.x and we can commit this improvement

jrockowitz’s picture

Version: 6.2.9 » 6.3.x-dev

jrockowitz changed the visibility of the branch 3533744-allow-signature-element to hidden.

jrockowitz’s picture

Status: Needs work » Reviewed & tested by the community

If the tests pass. this is RTBC

liam morland made their first commit to this issue’s fork.

  • jrockowitz committed 291d3cd5 on 6.3.x
    Issue #3533744 by apparatchik: Allow Signature Element To Notify Value...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

  • jrockowitz committed 291d3cd5 on 6.x
    Issue #3533744 by apparatchik: Allow Signature Element To Notify Value...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

bartvermeulen1’s picture

StatusFileSize
new336.95 KB

This change introduced some unwanted effect on tablets and mobile devices. From the moment you lift your finger, the signature gets smaller and pushed to left upper corner. When I remove the line that was introduced in this change, the behavior was back to normal.
Test was done with brand new Drupal 11 and webform 6.3 beta5.

aaronpinero’s picture

I can confirm the issue noted by bartvermeulen1 when using Webform on Drupal 10.5.4 and webform 6.3.0-beta5. If I comment out the line

$input.change();

the problem goes away. This is a significant UX problem because for a typical user signature (first and last name), a person will create at least 4 strokes in the signature. This results in a very weird user experience and a very tiny signature.

jrockowitz’s picture

Status: Closed (fixed) » Needs work

I reverted the commit. I am going to reopen this ticket but multiple people will need to confirm that this regression has been addressed before moving forward.

  • 6750b2a0 committed on 6.3.x
    Revert "Issue #3533744 by apparatchik: Allow Signature Element To Notify...

  • 6750b2a0 committed on 6.x
    Revert "Issue #3533744 by apparatchik: Allow Signature Element To Notify...