From 7878a405d3aef8da2da421b837babe82e4b0033b Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Wed, 12 Jan 2022 15:04:16 +0530 Subject: [PATCH] fix(ux): allow custom empty messages in autocomp - set custom message for State --- models/doctype/Address/Address.js | 6 ++++++ src/components/Controls/AutoComplete.vue | 2 +- src/components/Dropdown.vue | 22 ++++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/models/doctype/Address/Address.js b/models/doctype/Address/Address.js index 585cf2a0..bc993dff 100644 --- a/models/doctype/Address/Address.js +++ b/models/doctype/Address/Address.js @@ -50,6 +50,12 @@ export default { label: 'State', placeholder: 'State', fieldtype: 'AutoComplete', + emptyMessage: (doc) => { + if (doc.country) { + return 'Enter State'; + } + return 'Enter Country to load States'; + }, getList: getStates, }, { diff --git a/src/components/Controls/AutoComplete.vue b/src/components/Controls/AutoComplete.vue index 671cc81e..1e2955ad 100644 --- a/src/components/Controls/AutoComplete.vue +++ b/src/components/Controls/AutoComplete.vue @@ -1,5 +1,5 @@