origami icon indicating copy to clipboard operation
origami copied to clipboard

Component idea: o-window-modals

Open wheresrhys opened this issue 4 years ago • 1 comments

I keep using window.alert, window.prompt etc because, even though they are ugly, the amount of boilerplate to get these working is practically zero.

I would like to use o-overlay + o-forms but I can't really justify the effort. It also makes the codebase more complex for others to work with (we are not a team of front end dev specialists)

Is there a strong enough case for origami to build a component with a similar imperative api to window.prompt etc

so e.g.

const result = window.prompt('Answer me!')
handler(result)

could be replaced by

oWindowModals.prompt('Answer me!', handler)

Direct equivalence is probably not possible because the native implementations block the main thread, but I could work with that

wheresrhys avatar Dec 23 '21 09:12 wheresrhys

👍 Yes I think there's a strong case for ~burning o-overlay with fire~ deprecating o-overlay in favour of multiple, more usecase specific components. This sounds like a good suggestion to me.

notlee avatar Jan 04 '22 14:01 notlee