Unexpected confirm during fdk validate

Hello,

I’m getting the error “'Unexpected confirm.” during fdk validate but cannot find the reason. I know ES-lint sometimes has issues with this but window.confirm() generally works. Does anyone know how to work around this? There is nothing wrong with the line of code itself.

Since this is used from within a modal, I cannot use the Interface API (and I’d rather not go through Crayons just for the purpose of that confirmation popup).

if (window.confirm('Are you sure you want to confirm this task?')) {}

Thanks!

Hi @sabatale

Could you please add this line of code in first line of your if block

//eslint-disable-line

@sabatale ,
We generally discourage using native window.confirm ( this will break our UI styles across the application)
so kindly use our crayons or interface API to perform this.

Hope it helps :slight_smile:

Thanks

Thanks for the insight. As I mentioned, Interface API cannot be used here since it’s already within a side modal. However, Crayons seems to be changing a lot and we don’t want to start coding something that is going to be come obsolete soon: Modal (fw-modal) | Crayons (freshworks.com).

We see this has not been updated in a while and that breaking changes are planned ( feat(modal): Improving modal composability by adding modal-title, modal-content, modal-footer components. by Vignesh-Manogar-E3433 · Pull Request #248 · freshworks/crayons (github.com)). Do you know when 3.0 is planned? since this would make our work obsolete right away…!

It’s not in Storybook (freshdev.io) either.

Thanks.

1 Like

@sabatale
let me check and get back to you