Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
fix: fix input focus
Browse files Browse the repository at this point in the history
  • Loading branch information
tatinacher committed May 4, 2021
1 parent 6c649d5 commit c3f3e9b
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 247 deletions.
7 changes: 7 additions & 0 deletions src/lib/box-styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,10 @@ export const ColumnContent = styled.div`
export const TableContent = styled.div`
padding: 10px;
`;

export const Form = styled.form`
width: 100%;
& > div {
margin-bottom: 10px;
}
`;
10 changes: 4 additions & 6 deletions src/ui/atoms/input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react';
import styled, { StyledComponent } from 'styled-components';
import { Variant } from 'lib/types';

import { InputContainer, InputElement } from '../../elements/quarks';

interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
autoComplete?: 'on' | 'off';
className?: string;
disabled?: boolean;
leftIcon?: React.ReactNode;
Expand All @@ -16,6 +18,7 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
}

const InputBase: React.FC<InputProps & Variant> = ({
autoComplete = 'off',
className,
disabled = false,
leftIcon,
Expand All @@ -36,6 +39,7 @@ const InputBase: React.FC<InputProps & Variant> = ({
variant={variant}
>
<InputElement
autoComplete={autoComplete}
className={className}
disabled={disabled}
name={name}
Expand All @@ -48,16 +52,10 @@ const InputBase: React.FC<InputProps & Variant> = ({
);

export const Input = styled(InputBase)`
--local-vertical: calc(1px * var(--woly-component-level) * var(--woly-main-level));
--local-horizontal: calc(
var(--woly-const-m) + (1px * var(--woly-main-level)) + var(--local-vertical)
);
box-sizing: border-box;
width: 100%;
&[data-disabled='true'] {
pointer-events: none;
}
` as StyledComponent<'div', Record<string, unknown>, InputProps & Variant>;
Loading

0 comments on commit c3f3e9b

Please sign in to comment.