Skip to content

Commit

Permalink
Merge pull request #450 from kiwicom/fix/select-inputfile-help
Browse files Browse the repository at this point in the history
FIX: Select and InputFile help/error position
  • Loading branch information
tomashapl authored Oct 9, 2018
2 parents 8e4c802 + fe05db0 commit 01008bc
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 39 deletions.
10 changes: 5 additions & 5 deletions src/InputFile/__snapshots__/InputFile.stories.storyshot
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ exports[`Storyshots InputFile Default 1`] = `
}
>
<label
className="InputFile__Field-jAueAE dAafTj"
className="InputFile__Field-jAueAE erafpp"
data-test={undefined}
>
<input
Expand Down Expand Up @@ -488,7 +488,7 @@ exports[`Storyshots InputFile Filled with file 1`] = `
}
>
<label
className="InputFile__Field-jAueAE dAafTj"
className="InputFile__Field-jAueAE erafpp"
data-test={undefined}
>
<input
Expand Down Expand Up @@ -931,7 +931,7 @@ exports[`Storyshots InputFile Playground 1`] = `
}
>
<label
className="InputFile__Field-jAueAE dAafTj"
className="InputFile__Field-jAueAE erafpp"
data-test="test"
>
<input
Expand Down Expand Up @@ -1600,7 +1600,7 @@ exports[`Storyshots InputFile With error 1`] = `
}
>
<label
className="InputFile__Field-jAueAE dAafTj"
className="InputFile__Field-jAueAE erafpp"
data-test={undefined}
>
<input
Expand Down Expand Up @@ -2025,7 +2025,7 @@ exports[`Storyshots InputFile With help 1`] = `
}
>
<label
className="InputFile__Field-jAueAE dAafTj"
className="InputFile__Field-jAueAE erafpp"
data-test={undefined}
>
<input
Expand Down
1 change: 1 addition & 0 deletions src/InputFile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { Props } from "./index";
const Field = styled.label`
font-family: ${({ theme }) => theme.orbit.fontfamily};
display: block;
position: relative;
`;

Field.defaultProps = {
Expand Down
8 changes: 4 additions & 4 deletions src/InputGroup/__snapshots__/InputGroup.stories.storyshot
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ exports[`Storyshots InputGroup Date of birth 1`] = `
className="InputGroup__StyledChild-bpaCT jLivMh"
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<div
Expand Down Expand Up @@ -1180,7 +1180,7 @@ exports[`Storyshots InputGroup Phone number 1`] = `
className="InputGroup__StyledChild-bpaCT iMHnHh"
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<div
Expand Down Expand Up @@ -2082,7 +2082,7 @@ exports[`Storyshots InputGroup Playground 1`] = `
className="InputGroup__StyledChild-bpaCT daJJeL"
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<div
Expand Down Expand Up @@ -2161,7 +2161,7 @@ exports[`Storyshots InputGroup Playground 1`] = `
className="InputGroup__StyledChild-bpaCT frCGBA"
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<div
Expand Down
6 changes: 1 addition & 5 deletions src/Select/Select.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ storiesOf("Select", module)
<Select
label="Select box (with help text)"
options={objectOptions}
help={
<div>
Most common choice is <b>Booking cancellation</b>
</div>
}
help="Most common choice is Booking cancellation"
onChange={action("onChange")}
/>
),
Expand Down
42 changes: 18 additions & 24 deletions src/Select/__snapshots__/Select.stories.storyshot
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ exports[`Storyshots Select Default 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<div
Expand Down Expand Up @@ -564,7 +564,7 @@ exports[`Storyshots Select Playground 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test="test"
>
<div
Expand Down Expand Up @@ -1226,7 +1226,7 @@ exports[`Storyshots Select With CountryFlag prefix 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<span
Expand Down Expand Up @@ -1778,7 +1778,7 @@ exports[`Storyshots Select With error message 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<span
Expand Down Expand Up @@ -2326,7 +2326,7 @@ exports[`Storyshots Select With help message 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<span
Expand Down Expand Up @@ -2386,12 +2386,7 @@ exports[`Storyshots Select With help message 1`] = `
className="FormFeedback__StyledFormFeedback-cuFyWp jhMnDG"
data-test={undefined}
>
<div>
Most common choice is
<b>
Booking cancellation
</b>
</div>
Most common choice is Booking cancellation
</div>
</label>
</div>
Expand Down Expand Up @@ -2708,18 +2703,17 @@ exports[`Storyshots Select With help message 1`] = `
<span
style={Object {}}
>
<span>
{
<span
style={
Object {
"color": "#666",
}
<span
style={
Object {
"color": "#22a",
"wordBreak": "break-word",
}
>
&lt;div /&gt;
</span>
}
>
"
Most common choice is Booking cancellation
"
</span>
</span>
</span>
Expand Down Expand Up @@ -2877,7 +2871,7 @@ exports[`Storyshots Select With placeholder 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<span
Expand Down Expand Up @@ -3424,7 +3418,7 @@ exports[`Storyshots Select With prefix 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<span
Expand Down Expand Up @@ -3978,7 +3972,7 @@ exports[`Storyshots Select With small size 1`] = `
}
>
<label
className="Select__Label-hzoCkw iujhLZ"
className="Select__Label-hzoCkw fshYAU"
data-test={undefined}
>
<span
Expand Down
3 changes: 2 additions & 1 deletion src/Select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import SIZE_OPTIONS from "./consts";
import type { Props } from "./index";

const Label = styled.label`
width: 100%;
position: relative;
display: block;
`;

const StyledSelect = styled(
Expand Down

0 comments on commit 01008bc

Please sign in to comment.