From f45670a9a7e895fae32225eedcbfd3bcbd7c3d2c Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 7 Nov 2019 19:21:00 +0100 Subject: [PATCH] Don't suggest brands from incompatible countries in the Name field (close #6479) --- modules/ui/fields/localized.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/ui/fields/localized.js b/modules/ui/fields/localized.js index 8cf068ccc..3f362a26c 100644 --- a/modules/ui/fields/localized.js +++ b/modules/ui/fields/localized.js @@ -301,6 +301,11 @@ export function uiFieldLocalized(field, context) { if (value && value.length > 2) { for (var i = 0; i < suggestions.length; i++) { var s = suggestions[i]; + + // don't suggest brands from incompatible countries + if (_countryCode && s.countryCodes && + s.countryCodes.indexOf(_countryCode) === -1) continue; + var sTag = s.id.split('/', 2); var sKey = sTag[0]; var sValue = sTag[1];