Skip to content

Commit

Permalink
StringBuilder and Combobox2 fixes (#180)
Browse files Browse the repository at this point in the history
* this PR does following fixes
- fix copy and paste
- update value when using with formik
- fix Combobox2 and make a new build
- fix #178
  • Loading branch information
jay-deshmukh authored Feb 2, 2021
1 parent 3863b8d commit 8985606
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tyk-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tyk-ui.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tyk-technologies/tyk-ui",
"version": "2.1.2",
"version": "2.1.3",
"description": "Tyk UI - ui reusable components",
"main": "lib/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/Combobox2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@ function Combobox2(props) {
].join(' ');
return (
<div
className={getCssClasses()}
ref={rootRef}
tabIndex={disabled ? '-1' : '0'}
onClickCapture={onClickCapture}
{...restProps}
className={getCssClasses()}
>
{label && (
<label style={{ flexBasis: labelwidth || 'auto' }}>{label}</label>
Expand Down
8 changes: 3 additions & 5 deletions src/form/components/StringBuilder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ const StringBuilder = (props) => {
}, [tokenValue]);

useEffect(() => {
if (invalidTokenRegex) {
const tempVal = invalidTokenRegex ? value.replaceAll(invalidTokenRegex, ' $& ') : value;
setTokenValue(tempVal);
setTokenString(stringToTokenString(tempVal, options));
}
const tempVal = invalidTokenRegex ? value.replaceAll(invalidTokenRegex, ' $& ') : value;
setTokenValue(tempVal);
setTokenString(stringToTokenString(tempVal, options));
}, [value]);

/**
Expand Down
1 change: 1 addition & 0 deletions src/form/components/StringBuilder/js/string-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ const StringInput = ({
};

const handlePasteEvent = (e) => {
e.preventDefault();
const { clipboardData } = e;
const { selectionStart, selectionEnd } = e.target;
setIsPasteEvent(true);
Expand Down

0 comments on commit 8985606

Please sign in to comment.