Coder Social home page Coder Social logo

input's Issues

在 Mac 系统上使用中文输入法时,onPressEnter 是否存在问题?

公司项目使用了 Antd,而 Antd 依赖了 rc-input 的代码。通过查看源码后发现 onPressEnter 使用了 onkeydown 实现检查是否按下 Enter,但这种实现会导致在 Mac 系统上使用中文输入法的情况下,输入任意内容不选择任何联想项时按下 Enter 键,会触发对应逻辑,正常情况下应该不做处理?个人尝试后发现使用 onkeypress 是没有问题的。

这是我写的 最小复现 Demo,如果使用非 onkeypress 的方式捕获,则会触发此问题,Windows 貌似没有出现此问题。

rc-input 的最小复现

123123.mp4

Clear button is not accessible

Hello, we discovered that clear button which appears when allowClear property used is not accessible due to 2 reasons:

  • button wrapper uses tabindex=-1 which makes it inaccessible through the keyboard using tab/shift+tab
  • button wrapper uses span tag which prevent to click it via space or shift when it is on focus

I opened PR to fix this and added tests to check behavior, could you check it please

#63

selectionStart / selectionEnd are always 0

After this change (most likely) #54, which came into effect with antd 5.12.3, onchange event from the input always has selectionStart / selectionEnd properties set to 0 instead of the actual numbers

We have custom input processing (related to the currency formatting), which worked perfectly for the past 6 years until this change.

Would it be possible to have a look into this issue?

Add support for displaying remaining character count in rc-input

Currently, the rc-input package only provides support for displaying the character count of the provided input. It would be helpful to have the ability to switch to display the remaining character count also. This would be especially useful for situations where a user is limited to a specific number of characters, such as in form inputs or text areas.

I am requesting that support for displaying the remaining character count be added to the rc-input package. This would be a valuable addition to the package.

Thank you for considering this feature request.

Failed to set the 'selectionStart' property on 'HTMLInputElement': The input element's type ('email') does not support selection.

Recent change v1.4.3...v1.4.4#diff-94b5cf5856a42bc2e70f9e2b690fda2b65151186e6b007466ff6c6744c40e2c8R30

currentTarget.selectionStart = target.selectionStart; currentTarget.selectionEnd = target.selectionEnd;

breaks input type email functionality. With error:

Failed to set the 'selectionStart' property on 'HTMLInputElement': The input element's type ('email') does not support selection.

Click clear icon will set value to empty string

  const handleReset = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {
    setValue('');
    focus();
    if (inputRef.current) {
      resolveOnChange(inputRef.current, e, onChange);
    }
  };

Empty string is diffrent between undefined when it's sent to server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.