Skip to content

fix: hoist window.addSkill and remove duplicate broken submit listener#823

Open
nancysangani wants to merge 1 commit into
komalharshita:mainfrom
nancysangani:fix/skills-input-not-functioning
Open

fix: hoist window.addSkill and remove duplicate broken submit listener#823
nancysangani wants to merge 1 commit into
komalharshita:mainfrom
nancysangani:fix/skills-input-not-functioning

Conversation

@nancysangani

Copy link
Copy Markdown

Fixes #810

Three bugs in initIndexPage() in script.js caused all skill interactions to silently fail.

Root causes:

  1. skillsTextInput referenced but never declared — threw ReferenceError when form was submitted, preventing recommendations from generating
  2. window.addSkill defined inside the first submit handler instead of at initIndexPage() scope — chip click handlers and the Enter key handler found it undefined before any form submission occurred
  3. Duplicate form.addEventListener("submit") binding — the broken first listener was never removed when the correct second one was added

Changes:

  • static/script.js — hoisted window.addSkill to top of initIndexPage() scope; removed the entire broken first submit listener; no changes to the correct second submit listener
  • tests/test_skills_input.py — 35 tests covering DOM landmark presence, chip data-skill attributes, skillsTextInput absence, window.addSkill hoisting, single submit listener, Enter key wiring, and API payload contract

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@nancysangani is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@nancysangani

Copy link
Copy Markdown
Author

Hi @komalharshita, please review the PR when you get a chance. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills input and skill selection buttons are not functioning

1 participant