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

SearchPrompt captures a return key stroke from previous dialog #1044

Closed
martinservold opened this issue Oct 29, 2020 · 1 comment
Closed
Labels
Benign Bug Bug that doesn't stop user from using the tool but it makes it inconvenient [class] Enhancement Enhancement request [class->Improved #{number}: {title}]

Comments

@martinservold
Copy link

pyrevit Version 4.7.4

I have a script that has you make a selection (Electrical Equipment/Mechanical Equipment/etc) prior to starting the searchprompt for that category. On this prerequisite dialog if I select the option with the mouse the searchprompt works fine, but if I press Enter (return), the searchprompt captures that keystroke and immediately closes returning nothing.

To Reproduce

prereq = forms.alert('Select Option', options=['Electrical','Mechanical'])
if prereq is None:
    script.exit()
if prereq == 'Electrical':
    eq = LIST1
elif prereq == 'Mechanical':
    eq = LIST2
searched_eq = forms.SearchPrompt.show(eq, switches=[], search_tip=tip_info)
if searched_eq is None:
    script.exit()

My suggestion is:
In Pyrevit>Forms>init.py>SearchPrompt>handle_kb_key

elif args.Key == Input.Key.Enter:
    if self.search_tb.Text != '':
        self._setup_response(response=self._search_res)
        self.Close()
@eirannejad eirannejad added Benign Bug Bug that doesn't stop user from using the tool but it makes it inconvenient [class] Enhancement Enhancement request [class->Improved #{number}: {title}] labels Nov 2, 2020
eirannejad added a commit that referenced this issue Nov 2, 2020
enter no longer relaunches the pick tool
@eirannejad
Copy link
Collaborator

Fixed and will be published with next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benign Bug Bug that doesn't stop user from using the tool but it makes it inconvenient [class] Enhancement Enhancement request [class->Improved #{number}: {title}]
Projects
None yet
Development

No branches or pull requests

2 participants