fix: toggle skill selection on repeated tap
Tapping the same skill tile again deselects it, removing the highlight border and hiding the send bar input. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b49b5c8b9d
commit
cd6a837da3
1 changed files with 6 additions and 0 deletions
|
|
@ -694,6 +694,12 @@ function renderSkillsFromData(data) {
|
||||||
|
|
||||||
el.querySelectorAll('.skill-item').forEach(function(item) {
|
el.querySelectorAll('.skill-item').forEach(function(item) {
|
||||||
item.addEventListener('click', function() {
|
item.addEventListener('click', function() {
|
||||||
|
if (selectedSkill === item.dataset.skill) {
|
||||||
|
item.classList.remove('selected');
|
||||||
|
selectedSkill = null;
|
||||||
|
document.getElementById('send-bar').style.display = 'none';
|
||||||
|
return;
|
||||||
|
}
|
||||||
el.querySelectorAll('.skill-item').forEach(function(i) { i.classList.remove('selected'); });
|
el.querySelectorAll('.skill-item').forEach(function(i) { i.classList.remove('selected'); });
|
||||||
item.classList.add('selected');
|
item.classList.add('selected');
|
||||||
selectedSkill = item.dataset.skill;
|
selectedSkill = item.dataset.skill;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue