Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
fix(web): Click event bubbling in the text selection toolbar causes the pop-up to shrink abnormally (#268)
布莱恩·奥夫托·杰森张98ce08ad02ef
diff --git a/project/web/src/components/PublishDialog/compoents/TextSelectionToolbar.tsx b/project/web/src/components/PublishDialog/compoents/TextSelectionToolbar.tsxindex 11483bc9..85fef7df 100644--- a/project/web/src/components/PublishDialog/compoents/TextSelectionToolbar.tsx+++ b/project/web/src/components/PublishDialog/compoents/TextSelectionToolbar.tsx@@ -109,49 +109,77 @@ const TextSelectionToolbar = memo(({ containerRef, onAction }: TextSelectionTool<Button.Group size="small"><Buttonicon={<CompressOutlined />}- onClick={() => handleAction('shorten')}+ onClick={(e) => {+ e.stopPropagation()+ e.preventDefault()+ handleAction('shorten')+ }}title={t('aiFeatures.shorten' as any)}>{t('aiFeatures.shorten' as any)}</Button><Buttonicon={<ExpandOutlined />}- onClick={() => handleAction('expand')}+ onClick={(e) => {+ e.stopPropagation()+ e.preventDefault()+ handleAction('expand')+ }}title={t('aiFeatures.expand' as any)}>{t('aiFeatures.expand' as any)}</Button><Buttonicon={<EditOutlined />}- onClick={() => handleAction('polish')}+ onClick={(e) => {+ e.stopPropagation()+ e.preventDefault()+ handleAction('polish')+ }}title={t('aiFeatures.polish' as any)}>{t('aiFeatures.polish' as any)}</Button><Buttonicon={<TranslationOutlined />}- onClick={() => handleAction('translate')}+ onClick={(e) => {+ e.stopPropagation()+ e.preventDefault()+ handleAction('translate')+ }}title={t('aiFeatures.translate' as any)}>{t('aiFeatures.translate' as any)}</Button><Buttonicon={<TagsOutlined />}- onClick={() => handleAction('generateHashtags')}+ onClick={(e) => {+ e.stopPropagation()+ e.preventDefault()+ handleAction('generateHashtags')+ }}title={t('aiFeatures.generateHashtags' as any)}>{t('aiFeatures.generateHashtags' as any)}</Button><Buttonicon={<PictureOutlined />}- onClick={() => handleAction('generateImage')}+ onClick={(e) => {+ e.stopPropagation()+ e.preventDefault()+ handleAction('generateImage')+ }}title={t('aiFeatures.generateImage' as any)}>{t('aiFeatures.generateImage' as any)}</Button><Buttonicon={<VideoCameraOutlined />}- onClick={() => handleAction('generateVideo')}+ onClick={(e) => {+ e.stopPropagation()+ e.preventDefault()+ handleAction('generateVideo')+ }}title={t('aiFeatures.generateVideo' as any)}>{t('aiFeatures.generateVideo' as any)}