Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: #5063 - Bug: Census Place disappears temporarily when choosing C…
…ensus Date from the Census dropdown
- Loading branch information
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrapping the new line in $(.....) doesn't seem to work. It's OK without that.
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you be more specific about "doesn't seem to work".
This is what I see do:
Enter a value "Foo" into the place.
Select a census date/place (e.g. 1841 England).
The place changes to "England"
Click/tab in the place field.
Click/tab away from it.
Before the change, the field reverted to "Foo".
After the change, the fields remains as "England".
The explanation is that this field uses typeahead (autocomplete), and we need to use the typeahead API to set this.
The documentation is here: https://github.com/corejavascript/typeahead.js/blob/master/doc/jquery_typeahead.md#jquerytypeaheadval-val
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't the value in the place field remain at "Foo"? That would be my preferred result.
To achieve that would presumably mean testing to see if the place already contains a value and only updating that field with the typeahead if it is empty?
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you first select the desired census and then overwrite the location? The location is defined in the census template, but can be overwritten.
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You set it to "Foo" (by typing).
You changed it to, say, "England", by selecting the date/place from the list.
Setting focus to the place field shouldn't replace "England" with whatever was there before.
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but if I accidentally choose the wrong census initially and enter the place, changing the census choice deletes the place, which seems wrong
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get it?
You type Scotland into the place.
You select 1841/England (accidently).
The system enters England into the place.
You don't want this? You want it to stay as Scotland?
The whole point of this select/drop-down is a quick way to fill date/place.
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the more likely scenario (an actual case):
I select 1841/England - I should have chosen the 1851/England census but don't realise it yet.
The system enters 06 JUN 1841 into the date and England into the place:
I type the town first so that I can use auto-suggestions which add the county and country:
I have to select England in the place and then overtype St Ives into the place
The system suggests several options that begin with St Ives:
I choose St Ives, Cornwall, England (a commonly used place for me).
Realising I have chosen the 1841/England census rather than the 1851/England Census, I select the 1851/England Census
The system enters 30 MAR 1851 into the date and England into the place, overwriting St Ives, Cornwall, England
Can you see that making the system enter the country (England in the above example) into the place is not helpful?
The reason being that I use the system's automatic suggestions of the place, beginning with the town, to fill the place.
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. And you do it "out-of-sequence" - i.e. before using the date/place selector.
We can only update it if it doesn't contain the new string.
Thus "England" would overwrite "Scotland", but not "London, England"
b351811
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.