Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Add tips for CJK IME user story #305

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,17 @@ storiesOf('ChipInput', module)
.add('with "filled" variant full width', () => (
<ChipInput defaultValue={['foo', 'bar']} variant='filled' label='Add Tags' fullWidth fullWidthInput />
))
.add('tips for CJK IME user', () => (
<div>
<ChipInput
defaultValue={['猫', '犬']}
newChipKeys={[]}
onChange={action('onChange')}
/>
<div>
add <code>{"newChipKeys={[]}"}</code> to property.
default is <code>{"newChipKeys={['Enter']}"}</code>.
prevent onChange event when IME is processing key input.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we prevent this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when event.keyCode 13, IME is not processing key input.
when 229, IME is processing key input.
both situations have event.key === 'Enter'. so newChipKeys={[]} is prevent event when IME is processing key input.

My english isn't as good as Japanese, so I'm glad if you can fix it so that it can be understandable. 😺

</div>
</div>
))