Select the search bar text upon focus

This commit is contained in:
Quincy Morgan
2019-03-02 14:10:28 -05:00
parent a8d5a16a7d
commit 301d626784
2 changed files with 10 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);