@descope/web-components-ui 1.0.374 → 1.0.376

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,7 @@ var Color = require('color');
5
5
  var DOMPurify = require('dompurify');
6
6
  var MarkdownIt = require('markdown-it');
7
7
  require('lodash.debounce');
8
+ require('libphonenumber-js/min');
8
9
  var hljs = require('highlight.js');
9
10
 
10
11
  const DESCOPE_PREFIX = 'descope';
@@ -2624,13 +2625,19 @@ const inputEventsDispatchingMixin = (superclass) =>
2624
2625
  // since on load we can only sample the color of the placeholder,
2625
2626
  // we need to temporarily populate the input in order to sample the value color
2626
2627
  const getValueColor = (ele, computedStyle) => {
2628
+ // to support setting dynamic values, we have to store the existing value
2629
+ // and re-set it if we are returning from this hack
2630
+ const origVal = ele.value;
2631
+
2627
2632
  // eslint-disable-next-line no-param-reassign
2628
2633
  ele.value = '_';
2629
2634
 
2630
2635
  const valueColor = computedStyle.getPropertyValue('color');
2631
2636
 
2632
- // eslint-disable-next-line no-param-reassign
2633
- ele.value = '';
2637
+ if (ele.value === '_') {
2638
+ // eslint-disable-next-line no-param-reassign
2639
+ ele.value = origVal;
2640
+ }
2634
2641
 
2635
2642
  return valueColor;
2636
2643
  };