-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isEmpty
and multiline
methods should respect whether a subfield is visible
#82
Comments
That's interesting. We're currently populating the hidden subfields as a means of future-proofing and consistency... All of that data will be available in the future, regardless of which subfields you are using. But you make a good point, that this has an impact on both the I'm reluctant to skip saving those subfields when it's initially fetched, I don't like the idea of Address data having holes in it (whether visible or invisible). Instead, perhaps we can make the Let me take a look at what it would take to have |
@lindseydiloreto Good point – I personally wouldn't care about this, though I could see that other people might. Saving the data but modifying the field methods to never use the hidden values could work as well. Maybe this can be done in the If this logic is instead added to the individual methods on the |
isEmpty
and multiline
methods should respect whether a subfield is visible
+1 Not sure if there was an update that partially fixed this, but despite having the Country subfield hidden in the settings it's being included when outputting directly as a string via |
@jrrdnx Not sure, but it seems like your use-case might be slightly different. Here's how to show the whole address on a single line, without the country... {{ entry.myAddressField.multiline(1) }} Check out this comparison between Multiline vs. Formatted. The Hope that helps! |
Great news, this adjustment is available in v4.5.0! Both the |
@lindseydiloreto That will be useful, thanks! |
We usually hide some subfields in the address field that aren't relevant to our use-case – most often,
state
andcounty
. However, even if those fields are hidden, using the address autocomplete will fill out those fields with the values returned from the API. This is a problem:isEmpty()
method to returnfalse
instead oftrue
, even though all visible fields are empty.multiline
method, but they're not editable or useful.I think the best solution to this would be to have the autocomplete only write values to subfields that are visible in the address field. This way, all the autocompleted data is visible and editable, and
isEmpty()
will accurately returntrue
if all fields are manually emptied.The text was updated successfully, but these errors were encountered: