-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
How do I add multiple tabs functionality in the react Ace editor ? , Can somebody please provide a workaround, I am beginner in programming, If somebody could help me out it would be great #786
Comments
Thanks for the info. |
But the above solution does not retain undo functionality . |
This is because we use one editor for all tabs. Think we would need to implement something likes this Store each session in state and then reapplying it when the tab is changed. |
I will check it out . |
Having multiple editors and keeping some of them hidden seems like it will work for me, haven't tested extensively. {tabs.map((tab, i) => (
<AceEditor
key={i}
value={tab.content}
mode="python"
name={`CodeBlock_${i}`}
fontSize="0.9rem"
className="-mt-1 min-h-[4rem] overflow-clip rounded shadow-md"
style={{ display: i === tabIndex ? 'block' : 'none' }}
theme="idle_fingers"
onChange={(newValue) =>
dispatch({
type: 'SET_TABS',
payload: produce(tabs, (draft) => {
draft[i].content = newValue
}),
})
}
width="100%"
maxLines={Infinity}
onLoad={editorOnLoad}
editorProps={{ $blockScrolling: true }}
setOptions={editorOptions}
/>
))}
{showOutput && (
<pre className=" overflow-auto text-left">
<code>{stdout}</code>
<code className="text-red-500">{stderr}</code>
</pre>
)} |
Problem
Detail the problem here, including any possible solutions.
Sample code to reproduce your issue
References
Progress on: #
The text was updated successfully, but these errors were encountered: