smaranjitghose / doc2pen

An open source project aimed at making your student life easier!
https://doc2pen.smaranjitghose.com
Creative Commons Zero v1.0 Universal
380 stars 404 forks source link

Input area in the editor does not supports 'Tab' key. #1074

Closed prathamjagga closed 3 years ago

prathamjagga commented 3 years ago

Issue: When we press Tab key, in the input area on '/editor' page, it moves to the next field, instead 'a few spaces' must be indented for the user's accessibility.

Actual behavior: Pressing the 'Tab' key, moves control to the next field. Expected behavior: Pressing the 'Tab' key should provide indentation (a bunch of spaces) as other editors support. Steps to reproduce : (1) Go to '/editor' from the root (home-page). (2) Press the 'Tab' key on your keyboard.

Additional info: Machine: Windows 10 x64 arch. Node Version: 14.17.0

smaranjitghose commented 3 years ago

Would you like to resolve this bug?

prathamjagga commented 3 years ago

Would you like to resolve this bug?

I've tried a few javascript snippets but none of them works like targeting the id "show-text" of the text area but it is not working.

var input = document.querySelector("#show-text"); console.log(input); input.addEventListener('keydown', function (e) { // Capture the tab keyevent, and make it not do the default behavior. if (e.which === 9) { e.preventDefault(); alert("Tab failed"); }; });

I'm working on it! You can assign any other person too so as to collaborate.

prathamjagga commented 3 years ago

@smaranjitghose Sir, the issue is solved kindly review the PR #1075