vue-range-slider icon indicating copy to clipboard operation
vue-range-slider copied to clipboard

Can't typing on input and text area

Open thanhnx9368 opened this issue 5 years ago • 8 comments

Hi xwpongithub,

I have an issues with vue ranger slider. I have a page, it's using vue ranger slider and text area for user typing comment.

But when i implement your package. I can't typing anywhere on page and i can't reload with keyborads ( Command + R ).

Please to help me.

Thank you very much!!!

thanhnx9368 avatar Oct 10 '19 07:10 thanhnx9368

@thanhnx9368 I had the same issue. Try using this one: https://nightcatsama.github.io/vue-slider-component/#/api/props . Is exactly the same.

santi755 avatar Oct 14 '19 15:10 santi755

@thanhnx9368 I had the same issue. Try using this one: https://nightcatsama.github.io/vue-slider-component/#/api/props . Is exactly the same.

Thanks for your answers. It's helpful^^

thanhnx9368 avatar Oct 23 '19 04:10 thanhnx9368

This is essentially the same issue as #3, due to this component hijacking the events it needs across the entire document and cancelling them before deciding whether it actually wants to respond to them.

Here's a fixed "handleKeydown" method that can be dropped in place of the existing one (at around line 1345):

			handleKeydown: function handleKeydown(e)
			{
				console.log(this.useKeyboard);
				if (!this.useKeyboard)
				{
					return true;
				}

				var keyCode = e.which || e.keyCode;

				switch (keyCode)
				{
					case 37:
					case 40:
						this.keydownFlag = true;
						this.flag = true;
						this.changeFocusSlider(this.actionsKeyboard[0]);
						break;

					case 38:
					case 39:
						this.keydownFlag = true;
						this.flag = true;
						this.changeFocusSlider(this.actionsKeyboard[1]);
						break;

					default:
						break;
				}

				if (this.keydownFlag)
				{
					e.preventDefault();
					e.stopPropagation();
					return false;
				}
				return true;
			},

jasonkester avatar Nov 08 '19 09:11 jasonkester

I have the same issue, and when I looked on the source code I found he prevent any key down/up on the document !!!!! really it looks like stupid 😠 it should prevent the key down/up (or any event) in his inputs only not on the document.

mahmoudzohdi avatar Nov 15 '19 17:11 mahmoudzohdi

For now, you can fix this by pulling these quickfixes I made: #5

Anoesj avatar Jan 29 '20 20:01 Anoesj

It took me two days to find out that weird effect on my app is because of this library. Also they didn't accept the pull request for this issue.

I think its time to run npm uninstall vue-range-component

Bereket-G avatar Feb 15 '20 04:02 Bereket-G

This is essentially the same issue as #3, due to this component hijacking the events it needs across the entire document and cancelling them before deciding whether it actually wants to respond to them.

Here's a fixed "handleKeydown" method that can be dropped in place of the existing one (at around line 1345):

			handleKeydown: function handleKeydown(e)
			{
				console.log(this.useKeyboard);
				if (!this.useKeyboard)
				{
					return true;
				}

				var keyCode = e.which || e.keyCode;

				switch (keyCode)
				{
					case 37:
					case 40:
						this.keydownFlag = true;
						this.flag = true;
						this.changeFocusSlider(this.actionsKeyboard[0]);
						break;

					case 38:
					case 39:
						this.keydownFlag = true;
						this.flag = true;
						this.changeFocusSlider(this.actionsKeyboard[1]);
						break;

					default:
						break;
				}

				if (this.keydownFlag)
				{
					e.preventDefault();
					e.stopPropagation();
					return false;
				}
				return true;
			},

Thanks for the solve the problem

rohandhiman222 avatar Apr 17 '20 12:04 rohandhiman222

hi, you slider is awesome, much better then vue-slider-component, but, please, fix this problem. @xwpongithub

mrosminin avatar Sep 17 '21 08:09 mrosminin