From 7cc8a68d922e11b6168032b44ad70ac0c1df8749 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Tue, 18 Aug 2020 17:43:19 +0800 Subject: [PATCH] fix(AddressEdit): incorrect bottom fields when get focused --- src/address-edit/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/address-edit/index.js b/src/address-edit/index.js index ba0b117b4..e208cc87c 100644 --- a/src/address-edit/index.js +++ b/src/address-edit/index.js @@ -113,6 +113,12 @@ export default createComponent({ } return ''; }, + + // hide bottom field when use search && detail get focused + hideBottomFields() { + const { searchResult } = this; + return searchResult && searchResult.length && this.detailFocused; + }, }, watch: { @@ -290,13 +296,9 @@ export default createComponent({ }, render(h) { - const { data, errorInfo, searchResult, disableArea } = this; + const { data, errorInfo, disableArea, hideBottomFields } = this; const onFocus = (name) => () => this.onFocus(name); - // hide bottom field when use search && detail get focused - const hideBottomFields = - searchResult && searchResult.length && this.detailFocused; - return (