Comments (6)
Workaround:
function MyModalCtrl($modalInstance){
var codemirrorInstance = null;
this.codemirrorOptions = {
...
onLoad: function(cmInstance) {
codemirrorInstance = cmInstance;
}
};
setTimeout(function() {
codemirrorInstance .refresh();
}, 0);
}
angular.module('myModule').controller('MyModalCtrl', MyModalCtrl);
then in the HTML (assuming you use controllerAs
):
<ui-codemirror ng-model="MyModalCtrl.model"
ui-codemirror-opts="MyModalCtrl.codemirrorOptions"></ui-codemirror>
from ui-codemirror.
We duplicated this problem with this and I believe it is due to conditional visibility on container elements. Here's a plunkr showing this problem without using modals and just using conditional visibility. In our app, we have a conditionally visible area with a codemirror element in it, and then we have a button to expand it into a larger modal. BOTH areas showed this problem. We could fix the area that wasn't using a bootstrap modal by changing the containers with ng-show's and ng-hide's to ng-if's but this leaves the bootstrap problem. The bootstrap modal and our code both have the conditionally hidden elements in common.
For this reason, I don't think it's a bootstrap problem but rather a conditional visibility issue. I almost didn't find this issue because of the naming.
I tried the above workaround suggested by @sheymann, but couldn't get it to work.
from ui-codemirror.
The breaking change has apparently been introduced in 0.11.1. With 0.11.0 it still works as expected.
from ui-codemirror.
It still doesn't work in AngularUI Boostrapt 0.13.0
from ui-codemirror.
@agibson-fl what is your version of Angular? I've tested on v1.3.16 and Angular-UI v0.13.0.
from ui-codemirror.
@sheymann The plunkr I posted is using Angular v1.2.6. But our codebase is using v1.3.13. The ui-bootstrap version is 0.13. The same problem occurs. But again, I think this problem is not one with ui-bootstrap specifically but rather the visibility settings of the elements that contain the ui-codemirror element.
from ui-codemirror.
Related Issues (20)
- Unknown Provider error when using minified ui-codemirror.js HOT 8
- Refresh problems when switching pages HOT 3
- Form being marked as dirty when text contains line breaks preceeded by a space
- <textarea ui-codemirror> feedback: cursor error with ng-model HOT 1
- Can't see directive's scope when embedded in a custom directive HOT 1
- ui-codemirror needs CodeMirror to work... (o rly?) HOT 3
- Initial options do not get set due to $digest equality checks
- help me
- Two way databinding HOT 1
- [question] z-index set to 2
- How i can get value from ui-codemirror?
- Controller for ui-codemirror directive
- Indentation with ng-model
- copy (ctr + C) not working when use readOnly HOT 1
- Flick from a textarea to a ui-codemirror frame
- Error: uiCodemirror3 can only be applied to a textarea element HOT 1
- programaticaly adding content to ui-codemirror makes scrollbars buggy
- Cannot edit ui-codemirror in a taskpane of an add-in in Excel for Windows
- Is this dead?
- Live autocomplete support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui-codemirror.