Comments (3)
Building on this, it looks like the errors do not respect the locale
set by the I18nProvider
- see:
Note that the locale is set to es-ES
, and you can see the DateField
has the correct format for the locale (no leading zero), but the error is in English and has the incorrect format (it has a leading zero)
from react-spectrum.
Those error messages are the browser's built-in validation messages, so they rely on the browser's set language, not the provider's locale. There isn't currently a browser API for customizing this behavior. You can pass in custom error messages as an alternative instead: https://react-spectrum.adobe.com/react-spectrum/forms.html#customizing-error-messages
from react-spectrum.
Oh that's a shame. Is there a straightforward way to extract the date value from from the error? Or would regex be my only bet? Or should the date have the correct locale format already?
The main problem is the date not using the correct locale (and therefore causing client/server mismatch errors), so if I could easily extract this and format it correctly, then it wouldn't be a big of a concern.
Right now the server/client mismatch is our block.
EDIT: I suppose I could use the minValue
/maxValue
provided to the component, but this wouldn't give me the original browser-provided error message when using validationDetails
to specify it on the validationDetails.rangeOverflow
/ rangeUnderflow
and so I'd have to provide a custom (and therefore may as well translate) message itself
from react-spectrum.
Related Issues (20)
- useLongPress always disables user-select HOT 3
- Combobox Input requires hitting enter twice to submit a form HOT 3
- CheckboxGroup with more than one Text component that has unique id-props set causes an infinite React re-render loop HOT 2
- DropZone unexpectedly submits forms. HOT 2
- When multiple tooltips are open controlled, the first tooltip would not close after the cursor hovers on the second tooltip. HOT 1
- [@react-aria/live-announcer] "Uncaught Error: document is not defined" when used in render function in SSR HOT 1
- Event Bubbling Issue with Radio Component in Form Navigation HOT 4
- Yarn pnp error when loading @spectrum-icons: Could not resolve "@babel/runtime/helpers/extends" HOT 1
- ComboBox list items not scrolling HOT 9
- Support server-side rendering components with defaultOpen={true}
- addPerson defined but not used in example
- [react-aria-componets]: Checkbox imposible to visit links defined in Label HOT 6
- Popover closing after scroll in safari HOT 1
- Down / up arrow key navigation not working in Select component when VoiceOver enabled HOT 3
- @internationalization/date has two identical (?) module exports (also publint complains) HOT 1
- [RAC] `Popover` style inside `Select` & `ComboBox` does not works properly HOT 1
- Allow dateFields to have different formats HOT 7
- onClick cannot be triggered using continuePropagation HOT 3
- React Aria Starter Kit download (for Tailwind) is out of date with latest react-aria-components version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-spectrum.