Skip to content

Commit

Permalink
fix: form id example
Browse files Browse the repository at this point in the history
  • Loading branch information
aboveyunhai committed Jan 22, 2024
1 parent ca5b4c5 commit dc0e91f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions example/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const App = () => {
<Flex alignItems={'center'} gap={2}>
<Box marginRight={'1rem'}>closeOnSelect:</Box>
<Switch
name="closeOnSelect-switch"
isChecked={isSingleChecked}
onChange={(e) => setSingleCheck(e.currentTarget.checked)}
/>
Expand Down Expand Up @@ -185,7 +186,7 @@ const App = () => {
/>
</Flex>
<Flex gap="1rem" alignItems="center">
<label htmlFor={`popover-trigger-input`}>Input:</label>
<label htmlFor={`input`}>Input:</label>
<SingleDatepicker
id="input"
triggerVariant="input"
Expand All @@ -208,6 +209,7 @@ const App = () => {
<Flex alignItems={'center'} gap={2}>
<Box marginRight={'1rem'}>closeOnSelect:</Box>
<Switch
name="closeOnSelect-switch"
isChecked={isRangeChecked}
onChange={(e) => setRangeCheck(e.currentTarget.checked)}
/>
Expand All @@ -232,9 +234,7 @@ const App = () => {
/>
</Flex>
<Flex gap="1rem" alignItems="center">
<label htmlFor={`popover-trigger-input-range`}>
Input:
</label>
<label htmlFor={`input-range`}>Input:</label>
<RangeDatepicker
id="input-range"
triggerVariant="input"
Expand Down Expand Up @@ -554,7 +554,6 @@ const RangeCalendarDemo = () => {
const Section: React.FC<React.PropsWithChildren<{ title?: string }>> = ({
title,
children,
sectionProps,
}) => (
<VStack spacing={3} alignItems="flex-start" padding={'0.25rem'}>
<Heading size="md">{title}</Heading>
Expand Down
1 change: 1 addition & 0 deletions src/range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export const RangeDatepicker: React.FC<RangeDatepickerProps> = (props) => {
<Flex position="relative" alignItems={'center'}>
<PopoverAnchor>
<Input
id={id}
onKeyPress={(e) => {
if (e.key === ' ' && !isOpen) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/single.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ export const SingleDatepicker: React.FC<SingleDatepickerProps> = (props) => {
<Flex position="relative" alignItems={'center'}>
<PopoverAnchor>
<Input
id={id}
onKeyPress={(e) => {
if (e.key === ' ' && !isOpen) {
e.preventDefault();
onOpen();
}
}}
id={id}
autoComplete="off"
width={'10rem'}
disabled={disabled}
Expand Down

0 comments on commit dc0e91f

Please sign in to comment.