Comments (6)
The problem seems to be that A) the validation attributes are checked before the onsubmit event is fired, so if CodeMirror clears the textarea, it'll be happily submitted, because it had something in it before, and B) the hint that pops up when the form is not submitted (which happens when the texarea was empty to begin with), seems to be placed in such an incoherent way (at least on Chrome) that it either doesn't show up at all (when the textarea has an absolute position) or ends up way in the wrong place (when the textarea is given a height of 0).
There doesn't appear to be a way to make CodeMirror play nice with such attributes, short of reimplementing them, which is out of CodeMirror's scope.
from codemirror-v1.
Yes indeed.
So what do you choose? Saying that CodeMirror work only without required
attribute or maybe find a fix?
If you don't want to extend CodeMirror scope to reimplementing such attributes, would you accept checks for these attributes and notice if they're here ?
from codemirror-v1.
It could easily notice the attribute, or some other HTML5 validation attribute, is there, but how would it respond?
from codemirror-v1.
Not creating the CodeMirror object and fail with a log message so that the developer knows something is wrong and that he has to remove the required
attribute to make it work.
from codemirror-v1.
I'd say it is the library user's responsibility to not create CodeMirror instances for his/her textareas in such a case. There are a lot of other broken ways to use CodeMirror, and I don't want to start testing for all of them in the library (mostly for file size reasons -- such extra code adds up).
from codemirror-v1.
All right, fair enough.
from codemirror-v1.
Related Issues (20)
- Autocomplete HOT 4
- PHP Parser fails for some comments HOT 1
- C# parser problem with verbatim string HOT 1
- CodeMirror enterMode config param seems to be ignored if height is set. HOT 1
- Implement electric characters HOT 1
- lostundo missing reference in undo.js HOT 1
- Uncaught ReferenceError: lostundo is not defined HOT 1
- rewrite scrollToNode to just insert a node and check its coords if it needs to
- C# parser : bug with operators (fix inside) HOT 1
- this.editor is undefined (codemirror.js row 203) HOT 1
- content does not show HOT 9
- Liquid Mode for Codemirror2 HOT 6
- setValue() clears undo history HOT 1
- Speed up hideLine method HOT 1
- Pressing tab causes entire line to indent HOT 4
- unable to get separate history for multiple instances of codemirror HOT 4
- loadmode plugin does not work over non string modes HOT 1
- codemirror
- Mirror Demes
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 codemirror-v1.