MCPcopy Create free account
hub / github.com/dailydotdev/apps / onSlice

Function onSlice

packages/shared/src/components/fields/CodeField.tsx:45–53  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

43 };
44
45 const onSlice = (text: string) => {
46 const sliced = text.slice(0, length);
47 setCode(sliced.split(''));
48 onChange?.(sliced);
49
50 if (sliced.length === length) {
51 onSubmit(sliced);
52 }
53 };
54
55 const onPaste: ClipboardEventHandler<HTMLInputElement> = (e) => {
56 const text = e.clipboardData.getData('text');

Callers 2

onPasteFunction · 0.85
CodeFieldFunction · 0.85

Calls 2

onChangeFunction · 0.70
onSubmitFunction · 0.50

Tested by

no test coverage detected