Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ export default BasicExample;
<tr>
<td>
placeholder</td>
<td>string</td>
<td></td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>string | React.ReactNode;</td>
<td></td>
<td></td>
Expand Down
3 changes: 2 additions & 1 deletion examples/BasicExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ function BasicExample(props: Props) {
<form>
<h3>Email</h3>
<ReactMultiEmail
placeholder='Input your email'
label='Emails'
placeholder='Enter your email'
emails={emails}
onChange={(_emails: string[]) => {
setEmails(_emails);
Expand Down
7 changes: 5 additions & 2 deletions react-multi-email/ReactMultiEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export interface IReactMultiEmailProps {
) => React.ReactNode;
className?: string;
inputClassName?: string;
placeholder?: string | React.ReactNode;
label?: string | React.ReactNode;
placeholder?: string;
autoFocus?: boolean;
spinner?: () => React.ReactNode;
delimiter?: string;
Expand All @@ -48,6 +49,7 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
style,
className = '',
noClass,
label,
placeholder,
autoFocus,
allowDisplayName = false,
Expand Down Expand Up @@ -291,7 +293,7 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
onClick={() => emailInputRef.current?.focus()}
>
{spinning && spinner?.()}
{placeholder ? <span data-placeholder>{placeholder}</span> : null}
{label ? <span data-label>{label}</span> : null}
<div
className={'data-labels'}
style={{ opacity: spinning ? 0.45 : 1.0, display: 'contents', flexWrap: 'inherit' }}
Expand All @@ -302,6 +304,7 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
id={id}
style={{ opacity: spinning ? 0.45 : 1.0 }}
ref={emailInputRef}
placeholder={placeholder}
type='text'
value={inputValue}
onFocus={handleOnFocus}
Expand Down