Comments (4)
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.
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.
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.
Perhaps we do a isSSR check and turn off validation if true, we will need to figure out how though since the util for checking isSSR is from react aria and the validation happens in the stately hooks which shouldn't import from those packages since it is a circular dep.
from react-spectrum.
Related Issues (20)
- ListBoxItem wrapper can't access ListBox contexts HOT 4
- [React Aria Components] "Maximum update depth exceeded" when using SelectStateContext HOT 2
- Button onPress event on iOS can select the wrong element when virtual keyboard is open HOT 1
- [tailwindcss-react-aria-components] Option 'prefix' does not exist in type
- `react-aria-components/Tooltip`: `state.placement` should receive full `Placement` instead of `PlacementAxis` HOT 3
- [RAC] setting "hovered" modifier on button from dev tools does not trigger hover state HOT 1
- [RAC] ComboBox popover with `triggerRef` is not positioned correctly on SSR HOT 2
- Allow buttonLabelBehavior to be configurable in ActionBar's ActionGroup
- Using nested dialogs seems to depend on including a custom `<ModalOverlay/>` HOT 1
- Prevent focus on press of a button HOT 3
- Window is defined in Deno 1.x HOT 2
- DateRangePicker days change automatically when updating year in Thai Calendar HOT 1
- fromAbsolute in @internalization/date parses dates BC incorrectly
- Navigation through submenus (Menu/SubmenuTrigger) with key arrows are inverse when the submenu has placement="left" HOT 3
- Tooltip gets stuck to the screen while the user is scrolling over the screen. HOT 1
- Modal & ModalOverlay onOpenChange don't fire HOT 1
- "aria-hidden" does not work on Button component HOT 3
- ColumnResizer won't let go of focus with empty rows HOT 1
- Export `useSlot` & `useRenderProps` HOT 1
- `isDismissable` prop for `Modal` doesn't work when using a `ModalOverlay` component HOT 3
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.