Feature
- New property
setMaxIfBigger(defaulttrue) gives developers control over the auto-clamp-to-maxbehavior. When set tofalse, a keystroke that would push the value pastmaxis rejected and the display reverts to the last valid value — instead of jumping to the over-max digit sequence and snapping down tomax. Applied to bothformat()/unformat()(which skip the max clamp under the flag) and the directive (which tracks the last in-bounds display and restores it on overflow). Closes issue #96.
Fix
- The directive no longer leaves the host's
v-modelone keystroke behind the displayed value when applied to a wrapper component such as Vuetify's<v-text-field>, Nuxt UI's<UInput>, Element Plus's<el-input>, or any custom component that renders an inner<input>with its own@inputlistener. The wrapper attaches its listener during template render — before the directive'smounted()runs — so by DOM listener-order rules the wrapper's handler fired first and emitted the pre-reformat keystroke value, producing the off-by-10 v-model reported in #78 (typing9876.54left the display at$ 9,876.54while v-model captured$ 987.654). After reformatting,setValue()now re-dispatches a syntheticinputevent so the wrapper's listener re-reads the post-format value; a flag on the synthetic event guards against re-entry through the directive's ownoninput, andbubbles: falsekeeps the re-dispatch from reaching ancestor listeners that have nothing to do with the formatting pipeline. The re-fire is gated onhost !== el(i.e. only fires when the directive sits on a wrapper, not a bare<input>), so native<input v-money3 v-model>users see no behavior change and no duplicate event dispatch.
See the new "Use with wrapper components" section in the README for usage examples and the e.__v_money3_synth__ filter contract.
Full changelog: https://github.com/jonathanpmartins/v-money3/blob/v3.26.0/CHANGELOG.md