@descope/web-components-ui 3.22.2 → 3.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2343,6 +2343,13 @@ class EnrichedText extends createBaseClass$1({
2343
2343
  e.stopPropagation();
2344
2344
  }
2345
2345
  });
2346
+
2347
+ // The SDK submits the form (and prevents link activation) on any Enter that reaches the flow root
2348
+ this.contentNode?.addEventListener('keydown', (e) => {
2349
+ if (e.key === 'Enter' && e.target instanceof HTMLAnchorElement) {
2350
+ e.stopPropagation();
2351
+ }
2352
+ });
2346
2353
  }
2347
2354
 
2348
2355
  static get observedAttributes() {
@@ -9828,6 +9835,19 @@ const customMixin$c = (superclass) =>
9828
9835
  this.baseElement._setFocused = this.setFocus.bind(this);
9829
9836
 
9830
9837
  this.initExternalInput();
9838
+ this.stopRevealButtonEnterPropagation();
9839
+ }
9840
+
9841
+ // Vaadin toggles visibility on Enter keydown but lets the event bubble,
9842
+ // and the SDK submits the form on any Enter that reaches the flow root.
9843
+ stopRevealButtonEnterPropagation() {
9844
+ this.revealButton.addEventListener('keydown', (e) => {
9845
+ if (e.key === 'Enter') e.stopPropagation();
9846
+ });
9847
+ }
9848
+
9849
+ get revealButton() {
9850
+ return this.baseElement.querySelector('vaadin-password-field-button');
9831
9851
  }
9832
9852
 
9833
9853
  initExternalInput() {
@@ -9883,9 +9903,7 @@ const customMixin$c = (superclass) =>
9883
9903
  handlePasswordVisibility(externalInput) {
9884
9904
  // disable vaadin's `__boundRevealButtonMouseDown` mouse-down event lisetener
9885
9905
  const origBoundRevealButtonMouseDown = this.baseElement.__boundRevealButtonMouseDown;
9886
- this.baseElement
9887
- .querySelector('vaadin-password-field-button')
9888
- .removeEventListener('mousedown', origBoundRevealButtonMouseDown);
9906
+ this.revealButton.removeEventListener('mousedown', origBoundRevealButtonMouseDown);
9889
9907
 
9890
9908
  // disable vaadin's `_passwordVisibleChanged` observer
9891
9909
  this.baseElement._passwordVisibleChanged = () => {};