lobe-chat icon indicating copy to clipboard operation
lobe-chat copied to clipboard

๐Ÿ› fix: the input box is prone to losing focus

Open mushan0x0 opened this issue 1 year ago โ€ข 14 comments

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • [ ] โœจ feat
  • [x] ๐Ÿ› fix
  • [ ] โ™ป๏ธ refactor
  • [ ] ๐Ÿ’„ style
  • [ ] ๐Ÿ”จ chore
  • [ ] ๐Ÿ“ docs

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

Close #833

้˜ฒๆญข่พ“ๅ…ฅๆก†ๆ€ปๆ˜ฏๅคฑ็„ฆ

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

https://github.com/lobehub/lobe-chat/assets/29084441/867b26fe-c16b-4672-8b72-631322f60119

mushan0x0 avatar Dec 27 '23 15:12 mushan0x0

@mushan0x0 is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 27 '23 15:12 vercel[bot]

๐Ÿ‘ @mushan0x0

Thank you for raising your pull request and contributing to our Community Please make sure you have followed our contributing guidelines. We will review it as soon as possible. If you encounter any problems, please feel free to connect with us.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚ ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

lobehubbot avatar Dec 27 '23 15:12 lobehubbot

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (5e7985a) 84.94% compared to head (60f148a) 85.02%. Report is 1 commits behind head on main.

:exclamation: Current head 60f148a differs from pull request most recent head 086bd7d. Consider uploading reports for the commit 086bd7d to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #834      +/-   ##
==========================================
+ Coverage   84.94%   85.02%   +0.07%     
==========================================
  Files         167      168       +1     
  Lines        7501     7539      +38     
  Branches      760      768       +8     
==========================================
+ Hits         6372     6410      +38     
  Misses       1129     1129              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Dec 27 '23 15:12 codecov[bot]

็‚น topic searchใ€่ฟ˜ๆœ‰ alt ๅŒๅ‡ป topic ๅ‘ข๏ผŸ

arvinxx avatar Dec 27 '23 15:12 arvinxx

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Click topic search, and alt double-click topic?

lobehubbot avatar Dec 27 '23 15:12 lobehubbot

็‚น topic searchใ€่ฟ˜ๆœ‰ alt ๅŒๅ‡ป topic ๅ‘ข๏ผŸ

้ƒฝOK๏ผŒ้™ค้ž็‚นไบ†ๅˆซ็š„่พ“ๅ…ฅๆก†๏ผŒๅฆๅˆ™ไธไผšๅคฑๅŽป็„ฆ็‚น

https://github.com/lobehub/lobe-chat/assets/29084441/06e187cd-a9c9-43a9-bc9a-ce9075a80d21

mushan0x0 avatar Dec 27 '23 16:12 mushan0x0

ๆ”นไบ†ไธ‹๏ผŒ็Žฐๅœจๅฏไปฅๅ…จ็จ‹ๆ˜ฏ่š็„ฆ็Šถๆ€ไบ†

mushan0x0 avatar Dec 27 '23 16:12 mushan0x0

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


I changed it and now it can be in focus the whole time.

lobehubbot avatar Dec 27 '23 16:12 lobehubbot

@arvinxx ็œ‹็œ‹ๅ‘ข๏ผŒ้‡ๆ–ฐ็”จ้ผ ๆ ‡ไบ‹ไปถๅฎž็Žฐไบ†ไธ€ไธ‹๏ผŒๅฎŒๅ…จๆจกๆ‹Ÿๅพฎไฟก็š„็„ฆ็‚น้€ป่พ‘

mushan0x0 avatar Dec 28 '23 04:12 mushan0x0

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


@arvinxx Letโ€™s take a look. We implemented it again using mouse events, completely simulating WeChatโ€™s focus logic.

lobehubbot avatar Dec 28 '23 04:12 lobehubbot

@arvinxx ๆต‹่ฏ•ๅ’Œๆณจ้‡ŠๅŠ ๅฅฝไบ†

mushan0x0 avatar Dec 28 '23 05:12 mushan0x0

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


@arvinxx tests and comments added

lobehubbot avatar Dec 28 '23 05:12 lobehubbot

็”จๅฟซๆท้”ฎ่š็„ฆๅคชๅคšไฝ™ไบ†ๅง๏ผŒๅƒๅพฎไฟกqq่ฟ™ๆ ท็š„็„ฆ็‚นๅง‹็ปˆๅœจ่พ“ๅ…ฅๆก†ๅบ”่ฏฅๆ˜ฏๆœ€ๅฅฝ็š„๏ผŒๅณไฝฟ็‚นๆฅ็‚นๅŽป๏ผŒ่ฟ˜ๆ˜ฏๅฏไปฅ็›ดๆŽฅ่พ“ๅ…ฅๅ†…ๅฎน

mushan0x0 avatar Dec 28 '23 15:12 mushan0x0

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


It is too redundant to use shortcut keys to focus. It should be best to always focus on the input box like WeChat QQ. Even if you click here and there, you can still input content directly.

lobehubbot avatar Dec 28 '23 15:12 lobehubbot

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Comments Updated (UTC)
lobe-chat โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Dec 29, 2023 8:44am

vercel[bot] avatar Dec 29 '23 07:12 vercel[bot]

ๆœ‰ bug, ็ผ–่พ‘ๆถˆๆฏ็š„ๆ—ถๅ€™ๆ— ๆณ• focus, ๅผน็ช—้‡Œ็š„ input ๅ’Œ textarea ไนŸๆ˜ฏ @mushan0x0

https://lobe-chat-git-fork-mushan0x0-fix-input-blur-lobehub.vercel.app

image image

canisminor1990 avatar Dec 29 '23 07:12 canisminor1990

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


There is a bug, unable to focus when editing a message

lobehubbot avatar Dec 29 '23 07:12 lobehubbot

ๅค็Žฐๆ–นๆณ•, ๅฝ“ๆœ‰ๅคšไธช input ๅŒบๅŸŸๅ‡บ็Žฐ็š„ๆ—ถๅ€™

image

canisminor1990 avatar Dec 29 '23 08:12 canisminor1990

ๅปบ่ฎฎๆ”นๆˆๅชๅœจๅˆ‡ๆข ๅŠฉๆ‰‹ ๅ’Œ topic ๆ—ถๅšไธ€ๆฌกๆ€ง็š„่š็„ฆ

canisminor1990 avatar Dec 29 '23 08:12 canisminor1990

ๆ„Ÿ่ง‰ๅƒๆ˜ฏ vercel ้ข„่งˆ็Žฏๅขƒๅฏผ่‡ด็š„๏ผŒๆˆ‘ๅ…ˆ็œ‹็œ‹ๅ•ฅๆƒ…ๅ†ต

mushan0x0 avatar Dec 29 '23 08:12 mushan0x0

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


It is recommended to only do one-time focus when switching assistants and topics.

lobehubbot avatar Dec 29 '23 08:12 lobehubbot

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


It feels like it's caused by the vercel preview environment. I'll check what's going on first.

lobehubbot avatar Dec 29 '23 08:12 lobehubbot

@canisminor1990 https://lobe-chat-1-32b9htu5s-mushan0x0.vercel.app/chat ๆˆ‘่‡ชๅทฑ่ฟ™ไธช้ข„่งˆ็ŽฏๅขƒๅฎŒๅ…จๆฒก้—ฎ้ข˜ๅ‘ข๏ผŒไฝ ่ฟ™ไธชๅœฐๅ€ไปฃ็ ๆ˜ฏๆœ€ๆ–ฐ็š„ๅ—

mushan0x0 avatar Dec 29 '23 08:12 mushan0x0

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


@canisminor1990 https://lobe-chat-1-32b9htu5s-mushan0x0.vercel.app/chat My own preview environment is completely fine. Is your address code up to date?

lobehubbot avatar Dec 29 '23 08:12 lobehubbot

https://lobe-chat-1-32b9htu5s-mushan0x0.vercel.app/chat

ๆฒกๆƒ้™

canisminor1990 avatar Dec 29 '23 08:12 canisminor1990

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


https://lobe-chat-1-32b9htu5s-mushan0x0.vercel.app/chat

No permission

lobehubbot avatar Dec 29 '23 08:12 lobehubbot

@canisminor1990 https://lobe-chat-1-32b9htu5s-mushan0x0.vercel.app/chat ๆˆ‘่‡ชๅทฑ่ฟ™ไธช้ข„่งˆ็ŽฏๅขƒๅฎŒๅ…จๆฒก้—ฎ้ข˜ๅ‘ข๏ผŒไฝ ่ฟ™ไธชๅœฐๅ€ไปฃ็ ๆ˜ฏๆœ€ๆ–ฐ็š„ๅ—

ๆˆ‘่ฟ™ไธชๅœฐๅ€ๅฐฑๆ˜ฏ่ฟ™ไธชpr็š„้ข„่งˆ

canisminor1990 avatar Dec 29 '23 08:12 canisminor1990

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


@canisminor1990 https://lobe-chat-1-32b9htu5s-mushan0x0.vercel.app/chat My own preview environment is completely fine. Is your address code up to date?

My address is the preview of this PR

lobehubbot avatar Dec 29 '23 08:12 lobehubbot

ไฝ ่ฏ•่ฏ•ๅฝ“ๅญ˜ๅœจ้‚ฃไธช่ฆๆฑ‚ไฝ ่พ“ๅ…ฅๅฏ†็ ็›’api็š„ๆถˆๆฏๅญ˜ๅœจๆ—ถ๏ผŒไฝ ๅ†็‚น็ผ–่พ‘ๆถˆๆฏ

canisminor1990 avatar Dec 29 '23 08:12 canisminor1990

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


You try when there is a message asking you to enter the password box api, and then click edit message

lobehubbot avatar Dec 29 '23 08:12 lobehubbot