我正在使用Ionmic 7和Reaction 18.我有一个简单的项目列表,可以判断或编辑.
<IonList>
<IonLabel>
<strong>Select Items</strong>
</IonLabel>
{items.map((item) => (
<IonItem key={item}>
<IonCheckbox
slot="start"
name="selectedItems"
value={item}
/>
<IonLabel>{item}</IonLabel>
<IonIcon
icon={pencilOutline}
slot="end"
onClick={onEditHandler(item)}
style={{ marginLeft: '10px' }}
/>
</IonItem>
))}
</IonList>
问题是,当我点击我的"编辑"图标(铅笔)时,复选框被选中,并且我的编辑处理程序没有被调用.演示在这里--https://stackblitz.com/edit/an5yjh-i9tnnh?file=src%2FApp.tsx,src%2Fcomponents%2FFormWithChceckboxes.tsx.我想把这个加到操纵者身上
e.stopPropagation();
将阻止复选框被选中,该过程可以继续,但显然不会.