-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/onblur action disable (#141)
* add disableOnBlurValidation * Update readme add missing props * 예제 페이지 제작 * Remove unused code --------- Co-authored-by: Da-hwon Ju <[email protected]>
- Loading branch information
1 parent
dfff6aa
commit 9eb58fe
Showing
5 changed files
with
101 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as React from 'react'; | ||
import styled from '@emotion/styled'; | ||
import { ReactMultiEmail } from '../react-multi-email'; | ||
|
||
interface Props {} | ||
|
||
function DisableOnBlurValidation(props: Props) { | ||
const [emails, setEmails] = React.useState<string[]>([]); | ||
|
||
return ( | ||
<Container> | ||
<form> | ||
<h3>Email</h3> | ||
<ReactMultiEmail | ||
placeholder='Input your email' | ||
emails={emails} | ||
onChange={(_emails: string[]) => { | ||
setEmails(_emails); | ||
}} | ||
autoFocus={true} | ||
disableOnBlurValidation | ||
getLabel={(email, index, removeEmail) => { | ||
return ( | ||
<div data-tag key={index}> | ||
<div data-tag-item>{email}</div> | ||
<span data-tag-handle onClick={() => removeEmail(index)}> | ||
× | ||
</span> | ||
</div> | ||
); | ||
}} | ||
onChangeInput={value => { | ||
console.log(value); | ||
}} | ||
/> | ||
<br /> | ||
<h4>react-multi-email value</h4> | ||
<p>{emails.join(', ') || 'empty'}</p> | ||
</form> | ||
</Container> | ||
); | ||
} | ||
|
||
const Container = styled.div` | ||
font-size: 13px; | ||
`; | ||
|
||
export default DisableOnBlurValidation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react'; | ||
import type { NextPage } from 'next'; | ||
import { Container } from '../components/Layouts'; | ||
import styled from '@emotion/styled'; | ||
import BodyRoot from '../components/BodyRoot'; | ||
import DisableOnBlurValidation from '../examples/DisableOnBlurValidation'; | ||
|
||
const Custom: NextPage = () => { | ||
return ( | ||
<PageContainer> | ||
<Container> | ||
<div> | ||
<h2>DisableOnBlurValidation</h2> | ||
<p>If the DisableOnBlurValidation value is true, email validation is not performed as a blur event.</p> | ||
<DisableOnBlurValidation /> | ||
</div> | ||
</Container> | ||
</PageContainer> | ||
); | ||
}; | ||
|
||
const PageContainer = styled(BodyRoot)``; | ||
|
||
export default Custom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9eb58fe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-multi-email – ./
react-multi-email-git-master-axframe.vercel.app
react-multi-email-axframe.vercel.app
react-multi-email.vercel.app