How to Disable Cloning of a Form Field via ALT+CLICK

Product: Apryse WebVIewer

Product Version: 11.3

Issue Summary: Hello, I am encountering an issue with default key mappings in WebViewer. Specifically, I am unable to disable or override the standard behavior of ALT+CLICK , which clones a form field.

Our application requires custom handling of key events, and this default functionality interferes with our workflow. I could not find a method in the API to disable or override this behavior.

Expected Behavior:

  • Ability to prevent ALT+CLICK from cloning form fields.
  • A method to override or disable built-in key mappings such as ALT+CLICK , CTRL+CLICK , and SHIFT+CLICK .

Related Link

Best Regards,
William

1 Like

Hi there,

You should be able to override all of the keys in this API:
https://sdk.apryse.com/api/web/UI.Hotkeys.html#.Keys

Alt+click doesn’t exist within our list of keys, so you could also natively disable the alt key press like this:

document.addEventListener('keydown', function(event) {
  if (event.key === "Alt" || event.key === "AltGraph") {
    event.preventDefault();  // Prevent the default action (disables Alt key)
  }
});

best regards,
Kevin

1 Like

Hi Kevin,

I tried the suggested approach using the addEventListener('mouseLeftDown', ...) method, but the issue persists—ALT+CLICK still clones the form field. Unfortunately, I could not find a way to prevent this behavior using the available API methods.

Do you have any additional recommendations for disabling or overriding this functionality?

Best regards,
William

1 Like

Hi there,

This could be a potential bug, could you please share the exact steps took to reproduce the form field duplication?

best regards,
Kevin

1 Like