Signature_pad: μ„œλͺ…이 μž‘λ™ν•˜μ§€ μ•ŠμŒ Google Chrome, νœ΄λŒ€κΈ°κΈ°(λ„ˆλΉ„ >= 1080)

에 λ§Œλ“  2019λ…„ 03μ›” 18일  Β·  7μ½”λ©˜νŠΈ  Β·  좜처: szimek/signature_pad

μ•ˆλ…•,

λ¨Όμ € 노고에 κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€.

λ‘˜μ§Έ, λ„ˆλΉ„κ°€ 1080픽셀보닀 ν¬κ±°λ‚˜ 같은 일뢀 λͺ¨λ°”일 μž₯치(슀마트폰 및 νƒœλΈ”λ¦Ώ)_(HTC M9 Plus, Moto g(6) 및 Moto g5 Plus, Samsung SM-T385M λ“±)_에 λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. . μ΄λŸ¬ν•œ μž₯μΉ˜μ—μ„œλŠ” μ„œλͺ…이 μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ„œλͺ…을 μ‹œλ„ν•˜λ©΄ νŽ˜μ΄μ§€κ°€ 슀크둀 _(μœ„ λ˜λŠ” μ•„λž˜)_ν•˜κ³  μΊ”λ²„μŠ€μ— 점만 κ·Έλ¦½λ‹ˆλ‹€ (이미지 보기) . 이 λ¬Έμ œλŠ” Google Chromeμ—μ„œλ§Œ λ°œμƒν•˜λ©° Firefoxμ—μ„œλŠ” 잘 μž‘λ™ν•©λ‹ˆλ‹€ _(ν•˜λ‚˜ μ΄μƒμ˜ μ„œλͺ… 포함)_. λ‘˜ μ΄μƒμ˜ μ„œλͺ…이 μžˆλŠ” λ‹€λ₯Έ κ²½μš°μ—λŠ” 첫 번째 μ„œλͺ…λ§Œ μž‘λ™ν•˜κ³  λ‚˜λ¨Έμ§€λŠ” μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€(Google Chrome-).

Signature-pad Error

λΈŒλΌμš°μ € μ½˜μ†”μ„ λ³΄λ©΄μ„œ λ‹€μŒ 였λ₯˜λ₯Ό λ°œκ²¬ν–ˆμŠ΅λ‹ˆλ‹€.
[Intervention] Ignored attempt to cancel a touch event with cancelable = false, for example because scrolling is in progress and cannot be interrupted signature-pad.js:63

이 μ€„μ—μ„œ:
this._handleTouchEnd = function (event) { var wasCanvasTouched = event.target === self._canvas; if (wasCanvasTouched) { event.preventDefault(); self._strokeEnd(event); } };

λ‚˜λŠ” 그것을 λ‹€μŒκ³Ό 같이 λ°”κΏ¨λ‹€:
this._handleTouchEnd = function (event) { var wasCanvasTouched = event.target === self._canvas; if (wasCanvasTouched && event.cancelable) { event.preventDefault(); self._strokeEnd(event); } };

μ½˜μ†”μ˜ 였λ₯˜κ°€ ν‘œμ‹œλ˜μ§€ μ•Šμ•˜μ§€λ§Œ μ„œλͺ…이 아직 μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. 버전 2.3.0으둜 μ‹œλ„ν–ˆμ§€λ§Œ μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

μ•„λ§ˆ 그것에 λŒ€ν•΄ μ–΄λ–€ 생각이 μžˆμŠ΅λ‹ˆκΉŒ? 감사 ν•΄μš”.

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

μ•ˆλ…•,

λ‚˜λŠ” 이와 λ™μΌν•œ λ¬Έμ œκ°€ μžˆμ—ˆλŠ”λ° μ°½ λ‘œλ“œ 및 μ°½ 크기 μ‘°μ • κΈ°λŠ₯ λ‚΄μ—μ„œ λ‹€μŒμ„ κ΅¬ν˜„ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν–ˆλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€(저도 jQueryλ₯Ό μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€).

$('canvas.sig_canvas').each(function(){
  var id = $(this).attr('id'); //Get the ID of signature
  var width = $(this).closest('.sig_container').width(); //Get the width of the signature container
  sig_pads[id].off(); //Unbind all events on signature pad (I have an array of them)

  if(!$(this).data('prev_width') || Math.abs(width - $(this).data('prev_width')) > 30){ //Resize threshold 30px, only resize if previous width has changed by 30 pxs
    var ctx = $(this)[0].getContext('2d'); //Get context
    $(this).attr('width', width); //Set canvas width
    ctx.canvas.width  = width; //Set context width
    $(this).data('prev_width', width); //Update prev_width for threshold
  }
  sig_pads[id].on(); //Rebind all signature events
});

바인딩 ν•΄μ œ 및 리바인딩인지 λ˜λŠ” μΊ”λ²„μŠ€ λ„ˆλΉ„μ™€ κ³ μ •λœ κ²ƒμœΌλ‘œ λ³΄μ΄λŠ” μ»¨ν…μŠ€νŠΈ λ„ˆλΉ„λ₯Ό μ„€μ •ν–ˆλŠ”μ§€ ν™•μ‹€ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

도움이 되기λ₯Ό λ°”λžλ‹ˆλ‹€.

λͺ¨λ“  7 λŒ“κΈ€

μ™œ 그런 일이 일어날 수 μžˆλŠ”μ§€ μ „ν˜€ λͺ°λžμŠ΅λ‹ˆλ‹€. scroll μ΄λ²€νŠΈμ— λŒ€ν•œ λ¦¬μŠ€λ„ˆλ₯Ό μΆ”κ°€ν•˜κ³  "슀크둀링 진행 쀑"μ΄λΌλŠ” 였λ₯˜ λ©”μ‹œμ§€κ°€ μ˜¬λ°”λ₯Έμ§€ 확인할 수 μžˆμŠ΅λ‹ˆκΉŒ?

쩝. μ–΄λ”˜κ°€μ— 데λͺ¨λ₯Ό μ„€μ •ν•  수 μžˆμŠ΅λ‹ˆκΉŒ? λ‚˜λŠ” μ•„λ§ˆλ„ 1080보닀 높은 해상도λ₯Ό 가진 Android νƒœλΈ”λ¦Ώμ„ 가지고 μžˆμŠ΅λ‹ˆλ‹€.

지연 λΌμ„œ μ£„μ†‘ν•©λ‹ˆλ‹€.

예, μ €λŠ” ν• μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.

λ‚΄κ°€ 당신을 μœ„ν•΄ 데λͺ¨λ₯Ό μ„€μ •ν•  수 μžˆλŠ”μ§€ 보자.

@szimek ,

μ½”λ“œνŽœ:

scroll μ΄λ²€νŠΈμ— λŒ€ν•œ λ¦¬μŠ€λ„ˆλ₯Ό μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€. "슀크둀링"은 λΈŒλΌμš°μ € μ½˜μ†”μ„ μ—½λ‹ˆλ‹€.

@szimek

μ•ˆλ…•,

ν™•μΈν•΄λ³΄μ…¨λ‚˜μš”? @szimek :C

μ•ˆλ…•,

λ‚˜λŠ” 이와 λ™μΌν•œ λ¬Έμ œκ°€ μžˆμ—ˆλŠ”λ° μ°½ λ‘œλ“œ 및 μ°½ 크기 μ‘°μ • κΈ°λŠ₯ λ‚΄μ—μ„œ λ‹€μŒμ„ κ΅¬ν˜„ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν–ˆλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€(저도 jQueryλ₯Ό μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€).

$('canvas.sig_canvas').each(function(){
  var id = $(this).attr('id'); //Get the ID of signature
  var width = $(this).closest('.sig_container').width(); //Get the width of the signature container
  sig_pads[id].off(); //Unbind all events on signature pad (I have an array of them)

  if(!$(this).data('prev_width') || Math.abs(width - $(this).data('prev_width')) > 30){ //Resize threshold 30px, only resize if previous width has changed by 30 pxs
    var ctx = $(this)[0].getContext('2d'); //Get context
    $(this).attr('width', width); //Set canvas width
    ctx.canvas.width  = width; //Set context width
    $(this).data('prev_width', width); //Update prev_width for threshold
  }
  sig_pads[id].on(); //Rebind all signature events
});

바인딩 ν•΄μ œ 및 리바인딩인지 λ˜λŠ” μΊ”λ²„μŠ€ λ„ˆλΉ„μ™€ κ³ μ •λœ κ²ƒμœΌλ‘œ λ³΄μ΄λŠ” μ»¨ν…μŠ€νŠΈ λ„ˆλΉ„λ₯Ό μ„€μ •ν–ˆλŠ”μ§€ ν™•μ‹€ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

도움이 되기λ₯Ό λ°”λžλ‹ˆλ‹€.

@Steeveuk 사물에 λ”°λ₯΄λ©΄ SignaturePadInstance.off()λ₯Ό μ‚¬μš©ν•˜κ³  SignaturePadInstance.on()으둜 λ‹€μ‹œ ν™œμ„±ν™”ν•˜μ‹­μ‹œμ˜€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰

κ΄€λ ¨ 문제

chenks picture chenks  Β·  7μ½”λ©˜νŠΈ

kevinchung1026 picture kevinchung1026  Β·  5μ½”λ©˜νŠΈ

chitgoks picture chitgoks  Β·  5μ½”λ©˜νŠΈ

derUli picture derUli  Β·  3μ½”λ©˜νŠΈ

rmmackay picture rmmackay  Β·  7μ½”λ©˜νŠΈ