mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-27 16:03:52 +00:00
Select the search bar text upon focus
This commit is contained in:
@@ -597,6 +597,7 @@ button.add-note svg.icon {
|
||||
}
|
||||
.search-add .search-wrap:nth-last-child(2) {
|
||||
border-radius: 20px;
|
||||
border: none;
|
||||
}
|
||||
.search-add input[type='search'] {
|
||||
position: relative;
|
||||
|
||||
@@ -43,11 +43,20 @@ export function uiSearchAdd(context) {
|
||||
.attr('type', 'search')
|
||||
.call(utilNoAuto)
|
||||
.on('focus', function() {
|
||||
search.attr('focusing', true);
|
||||
popover.classed('hide', false);
|
||||
})
|
||||
.on('blur', function() {
|
||||
popover.classed('hide', true);
|
||||
})
|
||||
.on('click', function() {
|
||||
if (search.attr('focusing')) {
|
||||
search.attr('focusing', null);
|
||||
search.node().setSelectionRange(0, search.property('value').length);
|
||||
d3_event.preventDefault();
|
||||
d3_event.stopPropagation();
|
||||
}
|
||||
})
|
||||
.on('input', function () {
|
||||
var value = search.property('value');
|
||||
//list.classed('filtered', value.length);
|
||||
|
||||
Reference in New Issue
Block a user