chore: add dependency map for WDSInputWidget (#33638)

Fixes #31805

/ok-to-test tags="@tag.Anvil"<!-- This is an auto-generated comment:
Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9202955378>
> Commit: af2713e5baa3268df6a0fbb8b4b501682ba5097f
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9202955378&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
This commit is contained in:
Pawan Kumar 2024-05-23 13:40:16 +05:30 committed by GitHub
parent dd6daa4b18
commit ddac6dedb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 11 deletions

View File

@ -44,7 +44,7 @@ export const propertyPaneContentConfig = [
isBindProperty: false,
isTriggerProperty: false,
updateHook: inputTypeUpdateHook,
dependencies: ["dynamicHeight"],
dependencies: ["defaultText"],
},
{
helpText:

View File

@ -8,9 +8,7 @@ import {
INPUT_INVALID_TYPE_ERROR,
INPUT_TEXT_MAX_CHAR_ERROR,
} from "@appsmith/constants/messages";
import { InputTypes } from "components/constants";
import type { InputType } from "../component/types";
import { DynamicHeight } from "utils/WidgetFeatures";
import type { WidgetProps } from "widgets/BaseWidget";
import { INPUT_TYPES } from "../constants";
@ -142,14 +140,6 @@ export function inputTypeUpdateHook(
},
];
if (propertyValue === InputTypes.MULTI_LINE_TEXT) {
if (props.dynamicHeight === DynamicHeight.FIXED) {
updates.push({
propertyPath: "dynamicHeight",
propertyValue: DynamicHeight.AUTO_HEIGHT,
});
}
}
// if input type is email or password default the autofill state to be true
// the user needs to explicity set autofill to fault disable autofill
updates.push({

View File

@ -76,6 +76,12 @@ class WDSInputWidget extends WDSBaseInputWidget<InputWidgetProps, WidgetState> {
return {};
}
static getDependencyMap(): Record<string, string[]> {
return {
defaultText: ["inputType"],
};
}
onFocusChange = (focusState: boolean) => {
if (focusState) {
this.props.updateWidgetMetaProperty("isFocused", focusState, {