appsmith
appsmith copied to clipboard
feat: [APPSMTH-22] Execute action on widget focus and blur
Description
This PR enables onFocus and onBlur events on the following Widgets
- CurrencyInput
- Input
- PhoneNumber
- Select
- MultiSelect
- SingleTreeSelect
- MultiTreeSelect
- DatePicker
NB: This would require updating the Appsmith Documentation
Fixes #6452
Type of change
- New feature (non-breaking change which adds functionality)
- This change requires a documentation update
How Has This Been Tested?
- Cypress Tests
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
Welcome to the Appsmith community! Thank you for your first pull request and making this project better. 🤗 Please make sure that you raise a review request so your code change does not go unnoticed.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
appsmith | ✅ Ready (Inspect) | Visit Preview | Dec 9, 2022 at 5:59AM (UTC) |
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.
@Tooluloope Could you have a look at the select type widget's changes once?
/ok-to-test sha=e8770b8
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3537871241.
Workflow: Appsmith External Integration Test Workflow
.
Commit: e8770b8
.
PR: 18128.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18128&runId=3537871241_1
/ok-to-test sha=d897dd3
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3580765861.
Workflow: Appsmith External Integration Test Workflow
.
Commit: d897dd3
.
PR: 18128.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18128&runId=3580765861_1
@gitstart-appsmith can you move the "on submit" property to be just below the 'on blur' property so that on submit and reset on submit are together in input, currency and phone widget. Apologies if this was not informed in the prd or a change from it.
@dilippitchika QQ: what is the architecture currently if we switch page while having the input focus? https://www.loom.com/share/d0aca25f0846494b90d5d23d4f9c4e83
(pre-requisite: My input field already has the focus) I can see on switching pages, my input field triggers blur event and then again focus event to regain the old state. Is this how this should be ?
@kamakshibhat-appsmith i think this is expected in the standard web world that once you come back refocus will trigger the event again. Let me check this once though @sbalaji1192 also need your thoughts
@dilippitchika Also, there are some existing inconsistencies with the dropdowns. Do you think that could be a bottleneck for this feature as these inconsistencies would result in unintented onDropdownOpen/onDropdownClose events ? https://www.loom.com/share/c4955929b9f147529aefc90f9b855735
@kamakshibhat-appsmith on page change focus trigger is also there in html world, so it's a standard behavior - https://www.loom.com/share/331063111ccc4acb86a594ae6646ab59
@kamakshibhat-appsmith i think this is a problem with the widgets themselves and not with the onDropdownOpen/Close functionality as it also happens in production. If there's an issue already for it we can prioritise, if not please create one.
@dilippitchika @sbalaji1192 created issue #18576 . Let's prioritise this
@gitstart-appsmith can you move the "on submit" property to be just below the 'on blur' property so that on submit and reset on submit are together in input, currency and phone widget. Apologies if this was not informed in the prd or a change from it.
@dilippitchika Done
A small hiccup w.r.t opening modal on OnDropdownOpen . https://www.loom.com/share/ebcef675e9e64f7bbb5b5728e221a2a5 @dilippitchika @sbalaji1192 Let me know how to proceed with this
@dilippitchika This is a z-index issue. But before going there, Do you think we should provide openModal function for onFocus / onDropdownClose actions?
@sbalaji1192 we can choose not to show the action for open modal here, but is that possible today?
@kamakshibhat-appsmith i don't think this is a blocker for this issue to proceed though. Please create a new bug for it nevertheless.
@dilippitchika It's not possible as of today. But it should be simple to remove it from the action dropdown. but still, developer can switch to js and write the openModal function.
True unless we have a way to truly restrict some feature, this will be a limitation.
https://github.com/appsmithorg/appsmith/issues/18620 Created issue for overlapping of dropdown with modal.
tested and rest of the things looks good
/ok-to-test sha=1085701
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3617908982.
Workflow: Appsmith External Integration Test Workflow
.
Commit: 1085701
.
PR: 18128.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=18128&runId=3617908982_1
/ok-to-test sha=1085701
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3629175587.
Workflow: Appsmith External Integration Test Workflow
.
Commit: 1085701
.
PR: 18128.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18128&runId=3629175587_1
/ok-to-test sha=1085701
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3636363637.
Workflow: Appsmith External Integration Test Workflow
.
Commit: 1085701
.
PR: 18128.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18128&runId=3636363637_1