Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

XLSX is disabled in mobile devices #131

Closed
esaesa opened this issue Apr 25, 2018 · 1 comment
Closed

XLSX is disabled in mobile devices #131

esaesa opened this issue Apr 25, 2018 · 1 comment

Comments

@esaesa
Copy link

esaesa commented Apr 25, 2018

This sample https://tableexport.v3.travismclarke.com/examples/exportButtons.html and its modified v5 is not showing the xlsx button with a console warning tableexport.min.js:19 "xlsx" requires "js-xlsx".

image

I searched the code and i found

var _isEnhanced = (function () {
        return function (key) {
            return (
                XLSX
                && !_isMobile
                && !(TableExport.prototype.formatConfig[key].enforceStrictRFC4180)
            );
        }
    })();

which will return always false in mobile devices and so generate the error as dependency is required although it is loaded correctly and working in other older examples.
You can note in the image only two buttons instead of 3 as desktop version.

Update: 25,Apr. 2014


@clarketm
Copy link
Owner

clarketm commented Oct 26, 2018

@esaesa – I will investigate because this doesn't look correct. I will acknowledge that mobile support is not fully cross-platform (e.g. Safari mobile and some of the less common/popular mobile browsers). At the end of the day, this data is generated client-side, so full compatibility is not feasible, but most major mobile browsers should be supported, or this is a bug.

Now that I can recall, xlsx/ xls was so inconsistent on mobile browsers that it was disabled untill support could be delivered in a safe, consistent manner. I may have a fix but extensive cross-platform (and cross device) testing will be needed before I can safely add this support. Both csv and txt are fully supported, so logic can be added for mobile environments either in TableExport or in the implementation until this can be resolved. Sorry for the inconvenience.

The error "xlsx" requires "js-xlsx". is specifically related to a missing dependencies, so there is something 🐟y going on here (to your point about _isMobile check) and this error is misleading ... the purpose was originally to short-circuit the execution (hence why the button is not added for xlsx). There was a known issue with dataURIs on iphone (xlsx & xls) and native mobile browser support for Blob which may no longer be a problem. Either way, the issue(s) on mobile related to xls and xlsx need to be triaged and addressed. This will be fixed in the next minor release. Thanks for you help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants