Skip to content

A set of ameliorations for the PhoneNumberInput component #7529

Open
@elazzabi

Description

@elazzabi

Description

The PhoneNumberInput component has been introduced in Core. In order to use it in WooPayments, we need to copy-paste it here (we can't import it from Core due to some technical limitations) and fix a few things.

Here's a list of what needs to be fixed:

  • The RTL support's CSS is broken (see screenshot) because of this line that sets the CSS directly on the element, and thus it's not transformed to RTL part of the webpack process. We will need to figure out another way to apply the spacing for RTL, it’s done with JS to adjust the size to the option width.

  • We currently have a special case for Japan. If the account country is Japan, only Japanese numbers are accepted. We do this by passing onlyCountries to the component (as can be seen in the documentation). However, this is not possible in the new component. We need a way to pass props to the underlying component.

  • We added a custom behavior when you don't need to select a country before putting your number. This means that even if US +1 is selected, you can still put +212, and once you do that, it will automatically 1) detect the new country, 2) automatically select it in the dropdown and 3) remove the +212. This is not working in the new component.

Acceptance criteria

  • All the bugs listed above are working.

Designs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions