Giter Site home page Giter Site logo

Pristine is not preserved about ui-mask HOT 23 CLOSED

angular-ui avatar angular-ui commented on August 17, 2024
Pristine is not preserved

from ui-mask.

Comments (23)

marbletravis avatar marbletravis commented on August 17, 2024

@msimpson I had a similar issue, with a different potential solution (#30) however the issue seemed to have been resolved in version 1.4.2. What version are you working on?

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

@msimpson it also may have something to do with this
d120b8c

from ui-mask.

PowerKiKi avatar PowerKiKi commented on August 17, 2024

Closing since @marbletravis gave solutions

from ui-mask.

msimpson avatar msimpson commented on August 17, 2024

I'm on version 1.4.5, have been from the start, and neither comments are solutions. I don't have the time to make a demo of this issue. But if someone does, try it out--it's there.

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

@msimpson I wonder, is the element gaining focus? One solution I have had to use, not sure if its something that needs to change, is to limit the events to handle to ['input', 'keyup'].

The other day I was wondering (have not had time to look into it) if we can make the mask process (handle events) from focus and click without dirtying the model. For us only handling input and keyup is sufficient.

To override the config you just need to re-declare the config, we do it in our app.js

angular.module('...', []).value('uiMaskConfig', {
    maskDefinitions: {
        '9': /\d/,
        'A': /[a-zA-Z]/,
        '*': /[a-zA-Z0-9]/
    },
    clearOnBlur: false,
    eventsToHandle: ['input', 'keyup']
})

from ui-mask.

msimpson avatar msimpson commented on August 17, 2024

@marbletravis
Dropping focus does work around the issue, yes. But, again, this needs to be fixed at its core.

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

@msimpson Sorry, my bad for not re-reading the whole op.

I am not sure what purpose focus/click serve, for us we didn't see a change in any behavior when switching to just input/keyup. I may have some spare cycles friday to look at the core issue, but wondering if you or @PowerKiKi can offer any context as to why we handle those events anyway.

from ui-mask.

msimpson avatar msimpson commented on August 17, 2024

@marbletravis
I'm not sure why those events are watched, either. Perhaps just paranoia over the slew of events signaling modification. Also, I found that while removing click and focus does resolve the pristine/untouched issue for mouse interaction it fails when tabbing through the fields as keyup is caught instead. Therefore, I still have no solid workaround.

from ui-mask.

PowerKiKi avatar PowerKiKi commented on August 17, 2024

@marbletravis sorry, I don't have any explanation either. Your best bet is to dig through git blame.

from ui-mask.

petejordan avatar petejordan commented on August 17, 2024

suffering with this ui-mask issue dirtying an otherwise prisitine page when nothing happens but a collapse / expand for e.g.
still very much open issue (in Object {full: "1.4.5", major: 1, minor: 4, dot: 5, codeName: "permanent-internship"} at least.
what's the fix / work-around / hack / ???

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

@petejordan @msimpson I haven't had much time to devote to this. But I did implement some changes on my fork, which if it works I will create a pull request into the main repo. I can test this tomorrow afternoon, (I don't have a good test setup at home) but in the meantime if either of you want to test it out you can pull from here.

https://github.com/marbletravis/ui-mask

If you are using bower, see this SO https://stackoverflow.com/questions/19348076/installing-a-dependency-with-bower-from-url-and-specify-version

If you have time to verify please let me know the outcome.

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

No go, it still has some $pristine issues. I will keep looking at it. Please be patient, I can't work on this at work much (not part of my main tasks right now) and have a family that occupies the rest of my time. I think I can look at this some more Friday.

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

@PowerKiKi should we reopen this?

from ui-mask.

petejordan avatar petejordan commented on August 17, 2024

Yes! Yes! Please re-open.
The mask dirty seems OK but form still dirty.
Thx much,
petejordan
On Oct 7, 2015 3:54 PM, "marbletravis" [email protected] wrote:

No go, it still has some $pristine issues. I will keep looking at it.
Please be patient, I can't work on this at work much (not part of my main
tasks right now) and have a family that occupies the rest of my time. I
think I can look at this some more Friday.


Reply to this email directly or view it on GitHub
#41 (comment).

from ui-mask.

PowerKiKi avatar PowerKiKi commented on August 17, 2024

I reopen as requested by @marbletravis, but I won't be working on it.

Thanks @marbletravis for your past and future work on this issue.

from ui-mask.

bradrich avatar bradrich commented on August 17, 2024

I am also having this issue, but it is localized to IE only. Is this the case with everyone else's issues?

from ui-mask.

petejordan avatar petejordan commented on August 17, 2024

Chrome also has problem of false dirty.
On Oct 13, 2015 12:32 PM, "Brad Richardson" [email protected]
wrote:

I am also having this issue, but it is localized to IE only. Is this the
case with everyone else's issues?


Reply to this email directly or view it on GitHub
#41 (comment).

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

@bradrich I recall having some issues with IE, and I recall seeing a pull request to fix them. But can't find it anymore. Are you using latest?

from ui-mask.

bradrich avatar bradrich commented on August 17, 2024

1.4.7, yes, it is the latest version. I am not seeing the error in Chrome at this current moment, only IE.

from ui-mask.

blake-nouribekian avatar blake-nouribekian commented on August 17, 2024

Is anyone close to fixing this issue? All of the states are messed up. It should set them just like any other input would that is not using ui-mask on it. Right when I click or tab to the field I get my required error message even though it should only display the message when the field is dirty or has an error but since ui-mask is changing dirty right when the field is focused on it makes this impossible.

from ui-mask.

marbletravis avatar marbletravis commented on August 17, 2024

@blake-nouribekian There is a pull request in with a fix. Just waiting for approval. You can switch to my fork temporarily if you need it faster.

#51

from ui-mask.

blake-nouribekian avatar blake-nouribekian commented on August 17, 2024

Great... Thanks so much! I'm launching a business/website very soon so the less issues the better

from ui-mask.

Tim91084 avatar Tim91084 commented on August 17, 2024

I've got another pull request in for this issue, #57

from ui-mask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.