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

Hide keyboard from dialog #451

Open
kadyrovfriend opened this issue Dec 19, 2024 · 1 comment
Open

Hide keyboard from dialog #451

kadyrovfriend opened this issue Dec 19, 2024 · 1 comment

Comments

@kadyrovfriend
Copy link

Is there any way to hide widjets (specifically Button) from dialog programmatically?

I have this case:

  • User uploads video
  • User clicks button "Confirm"
  • On this click bot starts to upload this video to my server.
  • On upload finish bot moves to next dialog.

So video upload to server may take some time and i want to prevent user from clicking button "Confirm" again.

How can i hide this button after user clicked it?

@zax2002
Copy link
Contributor

zax2002 commented Dec 26, 2024

You can switch to a temporary window where there is no such button

await dialog_manager.switch_to(states.UPLOADING)
await dialog_manager.show()

await upload_file()

await dialog_manager.switch_to(states.DONE)

And also, you can use when condition, getter, dialog_data and dialog_manager.show() to change the display condition of the button and redraw the current window before uploading the file, but I'm not sure if the second option is a good one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants