Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with "Intl.NumberFormat() constructor": currencyDisplay 'narrowSymbol' throw an error on Safari #8985

Closed
pmrotule opened this issue Feb 3, 2021 · 7 comments
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript help wanted 🆘 You're encouraged to pick up this issue, a maintainer will come back to you and review your work.

Comments

@pmrotule
Copy link

pmrotule commented Feb 3, 2021

MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat

What information was incorrect, unhelpful, or incomplete?

We recently added the option currencyDisplay: 'narrowSymbol' in our code and as soon as it went live, we had a big wave of errors coming in from Safari users.

Basically, our prices got removed all over our site because Safari was throwing the following error:

currencyDisplay must be either "code", "symbol", or "name"

See also: https://stackoverflow.com/a/64473216/1895428

Specific section or headline?

Browser compatibility

What did you expect to see?

I would expect to see under "Browser compatibility" that Safari doesn't support currencyDisplay: 'narrowSymbol'

Did you test this? If so, how?

I tested it on Safari. It seems to also happen on any browser running on iOS.

MDN Content page report details
@myakura
Copy link
Contributor

myakura commented Feb 4, 2021

Looks like the support has landed on trunk.
https://trac.webkit.org/changeset/266031/webkit

and available in Safari Technology Preview (114 and above).
https://webkit.org/blog/11300/release-notes-for-safari-technology-preview-114/

So I guess it'll be supported in the coming version of Safari (14.1).

@myakura
Copy link
Contributor

myakura commented Feb 4, 2021

Perhaps someone could transfer this issue to mdn/browser-compat-data ?

@chrisdavidmills
Copy link
Collaborator

Good idea. Transferring.

@chrisdavidmills chrisdavidmills transferred this issue from mdn/content Feb 4, 2021
@queengooborg queengooborg added the data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label Feb 5, 2021
@ddbeck
Copy link
Collaborator

ddbeck commented Feb 9, 2021

Thanks for reporting this!

To fix this is a bit complex. To address the specific problem of narrowSymbol:

  1. We need a new subfeature of javascript.builtins.Intl.NumberFormat.NumberFormat for currencyDisplay_option (see NumberFormat.json).
  2. We need to populate that subfeature with versions for (at least) Safari.
  3. We need a note on that support statement saying that Safari throws the error for the narrowSymbol value and, probably, a partial_implementation flag.

More comprehensively—perhaps as follow up issues to this one—we ought to have a complete set of option subfeatures for Intl.NumberFormat().

I'd welcome one or more PRs working on this issue!

@ddbeck ddbeck added the help wanted 🆘 You're encouraged to pick up this issue, a maintainer will come back to you and review your work. label Feb 9, 2021
tujoworker added a commit to dnbexperience/eufemia that referenced this issue Mar 16, 2021
tujoworker added a commit to dnbexperience/eufemia that referenced this issue Mar 19, 2021
@queengooborg
Copy link
Collaborator

Looks like this was resolved by #10129!

@ddbeck
Copy link
Collaborator

ddbeck commented May 12, 2021

@vinyldarkscratch Could you elaborate a bit? I listed a number of fixes that would need to be made, but I'm not sure how the 14.1 data applies. I'm not saying it's not resolved, but it's different than what I've suggested and I'd like to understand better how that happened.

@queengooborg
Copy link
Collaborator

Sorry it took so long to respond. This was actually resolved by #9371, which also closed #9319, a duplicate issue describing the same situation. #9371 added the suggested subfeature and populated its data, adding a note describing the lack of narrowSymbol support in Safari. #10129 followed up to indicate that support has now been added in Safari 14.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript help wanted 🆘 You're encouraged to pick up this issue, a maintainer will come back to you and review your work.
Projects
None yet
Development

No branches or pull requests

6 participants
@chrisdavidmills @ddbeck @myakura @queengooborg @pmrotule and others