Closed TechShivvy closed 4 months ago
Hi @TechShivvy, unfortunately, the errors persist until the user submits the modal again. There is no workaround, and we don't have short-term plans to enhance for your need. I understand this is not a great answer for you, but it'd be appreciated if you could understand this.
Ah, cool. I appreciate your quick response and clarification. I did explore available slack resources online before reaching out here, so I understand the current limitations. Thanks for taking the time to address my query, even though there might not be an immediate workaround. I'll keep an eye out for any updates in the future. Thanks again! @seratch
I'm encountering an issue with clearing errors in Slack Bolt Python modal. When submitting a form in the modal, if there are validation errors [ack(response_action="errors",errors=errors]), the errors persist even after the user starts focusing on a particular field or provides valid input. I want the errors to be cleared as the user interacts with that form field.
Basically, I want to achieve a behavior similar to default fields in a modal. Currently, if I submit the form without filling in some default fields, the system displays "Please complete this required field." If the user starts filling in or selecting values for those fields, the error message goes away. I want the same functionality for custom fields in the modal. For example, in a static_select dropdown with numbers from 1 to 10 as options, if the user selects a value above 5, an error is thrown. However, if the user then selects a value below 5, I don't know how to clear the error.
Is this possible to do without changing the block_id or action_id of that field?
Reproducible in:
The
slack_bolt
versionslack-bolt==1.18.1 slack_sdk==3.26.2 slackeventsapi==3.0.1
Python runtime version
Python 3.10.13
OS info
Microsoft Windows [Version 10.0.19045.4046]
Steps to reproduce:
I have used the code by @seratch for demo purposes.
Expected result:
I expect that once the user starts focusing on a field or provides valid input, the corresponding error message should be cleared dynamically, similar to the behavior of default fields in Slack Bolt Python modals.
Actual result:
The error persists even after the user interacts with the field or provides valid input.
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.