Web-Dev-For-Beginners icon indicating copy to clipboard operation
Web-Dev-For-Beginners copied to clipboard

Fixed Issue #1346 child node selection, added last word handling, removed u…

Open saikishoreMSK opened this issue 1 year ago • 2 comments

…nnecessary span spaces, and added element existence checks

Description

This pull request addresses multiple issues in the typing game code, including:

  1. Child Node Selection:
  • Replaced childNodes with children in quoteElement to ensure only element nodes are selected, avoiding interference from text nodes.
  1. Handling the Last Word:
  • Added logic to handle the case when the last word is correctly typed. The game now displays a completion message and disables further input.
  1. UI Element Existence Check:
  • Added checks to ensure quoteElement, messageElement, and typedValueElement exist in the DOM before manipulation, preventing potential runtime errors.
  1. Removed Extra Spaces in span Elements:
  • Removed unnecessary spaces in generated elements for each word, ensuring accurate highlighting without display issues.

saikishoreMSK avatar Oct 29 '24 07:10 saikishoreMSK

This PR has not seen any action for a while! Closing for now, but it can be reopened at a later date.

github-actions[bot] avatar Dec 28 '24 08:12 github-actions[bot]

This PR has not seen any action for a while! Closing for now, but it can be reopened at a later date.

github-actions[bot] avatar Mar 05 '25 08:03 github-actions[bot]