aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-08-15 21:18:39 -0300
committerSebastian <sebasjm@gmail.com>2022-08-15 21:18:39 -0300
commitcdc8e9afdfb93bd8a90d1e6cf0ea9aa20159e43a (patch)
treee41339241843847f5f4573f08c138149f8dca995 /packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
parent004b1544f394ee9dbbd0687d98933932b017f979 (diff)
downloadwallet-core-cdc8e9afdfb93bd8a90d1e6cf0ea9aa20159e43a.tar.xz
destination ui
Diffstat (limited to 'packages/taler-wallet-webextension/src/mui/input/InputBase.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/InputBase.tsx38
1 files changed, 23 insertions, 15 deletions
diff --git a/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx b/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
index fc16b7ce4..fce82f9d2 100644
--- a/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
@@ -53,6 +53,8 @@ export function InputBaseRoot({
multiline,
focused,
fullWidth,
+ startAdornment,
+ endAdornment,
children,
}: any): VNode {
const fcs = useFormControl({});
@@ -61,6 +63,8 @@ export function InputBaseRoot({
data-disabled={disabled}
data-focused={focused}
data-multiline={multiline}
+ data-hasStart={!!startAdornment}
+ data-hasEnd={!!endAdornment}
data-error={error}
class={[
_class,
@@ -156,22 +160,28 @@ export function InputBaseComponent({
multiline,
type,
class: _class,
+ startAdornment,
+ endAdornment,
...props
}: any): VNode {
return (
- <input
- disabled={disabled}
- type={type}
- class={[
- componentStyle,
- _class,
- disabled && componentDisabledStyle,
- size === "small" && componentSmallStyle,
- // multiline && componentMultilineStyle,
- type === "search" && searchStyle,
- ].join(" ")}
- {...props}
- />
+ <Fragment>
+ {startAdornment}
+ <input
+ disabled={disabled}
+ type={type}
+ class={[
+ componentStyle,
+ _class,
+ disabled && componentDisabledStyle,
+ size === "small" && componentSmallStyle,
+ // multiline && componentMultilineStyle,
+ type === "search" && searchStyle,
+ ].join(" ")}
+ {...props}
+ />
+ {endAdornment}
+ </Fragment>
);
}
@@ -388,7 +398,6 @@ export function TextareaAutoSize({
getStyleValue(computedStyle, "border-bottom-width") +
getStyleValue(computedStyle, "border-top-width");
- // console.log(boxSizing, padding, border);
// The height of the inner content
const innerHeight = inputShallow.scrollHeight;
@@ -412,7 +421,6 @@ export function TextareaAutoSize({
outerHeight + (boxSizing === "border-box" ? padding + border : 0);
const overflow = Math.abs(outerHeight - innerHeight) <= 1;
- console.log("height", outerHeight, minRows, maxRows);
setState((prevState) => {
// Need a large enough difference to update the height.
// This prevents infinite rendering loop.