Skip to content

Commit

Permalink
Remove button
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeGuilherme committed Sep 9, 2024
1 parent bbf7beb commit 1fe0168
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ moveBySearch = (val, searchEl) => {
errorEl.id = 'error-message';
errorEl.style.color = 'red';
errorEl.style.margin = '5px';
errorEl.textContent = 'Nenhuma feature encontrada.';
errorEl.textContent = 'Nenhum produto encontrado.';
searchEl.appendChild(errorEl);
}
};
Expand All @@ -285,23 +285,19 @@ loadSearch = (searchElId) => {

let input = `
<div style="display: flex; align-items: center; margin: 5px;">
<span style="margin-right: 5px;">MI:</span>
<input id="input" type="text" style="flex: 1; padding: 5px;" placeholder="MI/INOM"/>
<button id="searchBtn" style="cursor: pointer; margin-left: 5px; padding: 5px;">🔍</button>
</div>
`;

searchEl.innerHTML = input;

let inputField = document.getElementById('input');
let searchBtn = document.getElementById('searchBtn');

const executeSearch = () => {
let value = inputField.value;
moveBySearch(value, searchEl);
};

searchBtn.addEventListener('click', executeSearch);
inputField.addEventListener('keydown', function(event) {
if (event.key === 'Enter') {
executeSearch();
Expand Down

0 comments on commit 1fe0168

Please sign in to comment.