Commit Graph

27 Commits

Author SHA1 Message Date
Quincy Morgan
ed79ba1289 Highlight relations when hovering over them in the raw membership dropdown list (close #2946) 2019-08-21 09:37:45 -05:00
Quincy Morgan
67afa20dc0 Let comboboxes filter against terms, not just values
Add terms property to fields
Make terms translatable for searchable fields
Account for fields' terms and keys when filtering with the Add field menu (close #5763)
2019-08-09 11:12:40 -05:00
Bryan Housel
48b1ddc925 Rename fetch to fetchComboData to not conflict with fetch API 2019-04-24 16:24:36 -04:00
Quincy Morgan
95f8ed9416 Fix issue where clicking the combobox caret would not open the dropdown 2019-02-19 09:46:39 -05:00
Bryan Housel
a363f5175f Fix tabbing beyond last row of raw tag editor in Firefox
(closes #5847)

- removed the stopPropagation from the combobox keydown handler
  to make sure that the raw_tag_editor keydown handler will run

- increased timeout from 1ms to 10ms for Firefox
  This is related to Firefox's newish time budgeting approach that they
  started using around Firefox 55.  As a result, very fast timers (<4ms?)
  may run synchronously instead of yielding and running asynchronously
  https://blog.wanderview.com/blog/2017/03/13/firefox-52-settimeout-changes/

  (note similar code in ui/fields/combo.js to delay focus changes and
  redraws 10ms after the tag changes and other events have completed)
2019-02-07 15:56:49 -05:00
Bryan Housel
640730d38b Change focus to existing key instead of suffixing it with _1
(re: #3625, re: #2896)
2019-02-06 10:29:09 -05:00
Bryan Housel
af8fb1d758 Show combobox if we are moving from a different active combobox
(closes #5752)

Previously it would go down the `hide()` branch anytime an existing combobox
was active.
2019-01-28 16:22:37 -05:00
Bryan Housel
87ddfa68dc Revert 55715a482 - caused raw_tag_editor combos to not blur in Safari 2019-01-28 11:20:32 -05:00
Bryan Housel
b9444ab991 Restore hand cursor on dropdown carat
(closes #5769)

This change allows pointer events to flow to the caret, and forwards
them back to the combo input.  Also renames several event handlers
for clarity, and increases the double-click detection threshold.
2019-01-26 13:22:31 -05:00
Bryan Housel
18d71448be pacify eslint 2019-01-25 16:23:46 -05:00
Bryan Housel
55715a4827 Try to dispatch an accept event on blur
(re: #5752 - but does not close it)
2019-01-25 14:47:17 -05:00
Bryan Housel
4583e2d4d7 Make sure all combo event listeners can handle accept/cancel w/o datum
(re: #5637, re: #5618)

This can happen if the user enters a value that is not matched to
one of the combo suggestions.

Also make sure to set `this` to the input field.  It might not be
already if the event was triggered from a keypress instead of a click.
2019-01-22 23:14:34 -05:00
Bryan Housel
0c7b9a631e Improve combobox event handling and avoid overwriting typed data
(closes #5722, re: #5637, re: #5618)

dispatched with a value() string instead of a datum, which
causes issues for code expecting a datum always.
(such as localized.js brand picker or "Add Field" combo)

Fix for this coming in next commit.
2019-01-22 22:26:27 -05:00
Bryan Housel
1ec5b708fc Restore default click behaviors on mousedown of a combobox
(closes #5732)
2019-01-18 23:23:35 -05:00
Bryan Housel
5f2d80c7a6 pacify eslint 2019-01-08 10:58:47 -05:00
Bryan Housel
4f0a608439 Merge pull request #5637 from openstreetmap/5618
fix autocomplete combobox bug
2018-12-26 15:15:29 -05:00
Max Grossman
e3407d4168 do not use mouseover, use mousedown!
ref #5596
2018-12-20 09:05:23 -05:00
Max Grossman
2dab19e9ae default to value() if neither d and choice are null in the accept function
ref #5618
2018-12-20 08:52:16 -05:00
Max Grossman
5a1dfeec72 open combobox if anywhere on box clicked...
ref #5596
2018-12-20 08:47:37 -05:00
Bryan Housel
e08bfb2add Simplify accept/cancel event dispatchers, store datum in _choice 2018-12-12 15:26:18 -05:00
Bryan Housel
fc1f7e4d46 Trigger a change event when accepting combo option with return, tab
(closes #4900, closes #5449)

Some browsers need an explicit `change` event triggered on the input field
when a value has been changed by the combo and accepted by pressing return
or tab.  This was only an issue on combos that aren't part of uiFields,
since the uiFields are all setup to respond to `change`,`input`,`blur` etc.
2018-12-11 23:25:47 -05:00
Bryan Housel
39b3f1df68 Avoid creating comboboxes
(closes #5568)

Several strategies in here:
- Move uiCombobox() from inside the render function to class variable
- Don't render stuff like the raw tag editor when it's collapsed
- Don't show as many fields/combos on hover
- Don't instantiate fields (like universal/more) until they're actually shown
- Bind the combo on enter selection not on update selection
2018-12-11 16:07:00 -05:00
Bryan Housel
6732ca6eda Comboboxes no longer show on focus.. update tests 2018-12-11 01:19:51 -05:00
Bryan Housel
ff646fa2c8 Dispatch a 'cancel' event if the user hits escape 2018-12-11 00:09:55 -05:00
Bryan Housel
6cf1d63b48 Make sure dropdown doesn't remain visible
(closes #5575)

Also improves keyboard navigation, and adds some scrollintoview
workarounds to make sure that the selected option is visible
while also not causing the whole page to move.
2018-12-10 23:54:06 -05:00
Bryan Housel
15a54cab17 Use context.container instead of passing it in 2018-12-10 14:14:27 -05:00
Bryan Housel
e5dedeff8b Move lib/d3.combobox.js -> ui/combobox.js
As with other things from this lib/ folder, little original code remains
and turning these things into reusable d3 plugins is not a priority.
2018-12-10 12:38:21 -05:00