Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: customized inputElement should not trigger close when mousedown trigger #761

Merged
merged 3 commits into from
May 19, 2022

Conversation

MadCcc
Copy link
Member

@MadCcc MadCcc commented May 19, 2022

@vercel
Copy link

vercel bot commented May 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
select ✅ Ready (Inspect) Visit Preview May 19, 2022 at 0:46AM (UTC)

@MadCcc MadCcc changed the title fix: customized trigger should not trigger close when mousedown trigger fix: customized inputElement should not trigger close when mousedown trigger May 19, 2022
@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #761 (5471af9) into master (ca95af6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #761   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files          25       25           
  Lines        1009     1020   +11     
  Branches      320      341   +21     
=======================================
+ Hits         1004     1015   +11     
  Misses          4        4           
  Partials        1        1           
Impacted Files Coverage Δ
src/BaseSelect.tsx 100.00% <ø> (ø)
src/hooks/useSelectTriggerControl.ts 94.44% <100.00%> (+0.69%) ⬆️
src/Select.tsx 100.00% <0.00%> (ø)
src/SelectTrigger.tsx 100.00% <0.00%> (ø)
src/Selector/Input.tsx 100.00% <0.00%> (ø)
src/hooks/useOptions.ts 100.00% <0.00%> (ø)
src/OptionList.tsx 99.29% <0.00%> (+0.01%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

};

React.useEffect(() => {
function onGlobalMouseDown(event: MouseEvent) {
// If trigger is customized, Trigger will take control of popupVisible
if (propsRef.current.customizedTrigger) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (propsRef.current.customizedTrigger) {
if (propsRef.current?.customizedTrigger) {

@MadCcc MadCcc merged commit fe0fbd9 into master May 19, 2022
@MadCcc MadCcc deleted the fix/customizedTrigger branch May 19, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants