Fix(ui): Enter on an empty MAC Lookup input does nothing

The shared parser rejects an empty string, so Enter in the empty field
showed "Invalid physical address". onSubmit now returns early on empty
input, as IP Calculator does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jason5ng32andClaude Opus 5.5 committed 2026-10-05 11:29:50 +08:00
1 parent 87d49cec3d
commit d3df177df9
1 file changed
+2 -1
@@ -178,10 +178,11 @@ const validateInput = (input) => {
};
const onSubmit = () => {
const raw = queryMAC.value.trim();
if (!raw) return;
trackEvent('Section', 'StartClick', 'MACChecker');
errorMsg.value = '';
macCheckResult.value = {};
const raw = queryMAC.value.trim();
picked.value = EXAMPLES.some((e) => e.input === raw) ? raw : '';
const query = validateInput(raw);
if (query) getMacInfo(query);