MCPcopy Create free account
hub / github.com/Lobos/react-ui / handle

Function handle

src/Modal.js:121–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119 let func = options.buttons[btn],
120 status = j === 0 ? 'primary' : '',
121 handle = () => {
122 if (func === true) {
123 this.close();
124 } else if (func === 'submit') {
125 let form = this.elements[options.id].querySelector('form');
126 if (form) {
127 let event;
128 if (CustomEvent) {
129 event = new CustomEvent('submit', { bubbles: true, cancelable: true });
130 } else {
131 event = document.createEvent('HTMLEvents');
132 event.initEvent('submit', true, true);
133 }
134 form.dispatchEvent(event);
135 }
136 } else {
137 if (func()) {
138 this.close();
139 }
140 }
141 };
142 return <Button status={status} key={btn} onClick={handle}>{btn}</Button>;
143 });
144 }

Callers

nothing calls this directly

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…