Comments (18)
I have fixed that issue changing the popper strategy to fixed. Accessing the popover ref we can change the positionFixed
data to true
.
Example:
onMounted(() => {
datePickerRef.value.popoverRef.positionFixed = true
})
from v-calendar.
If a parent container has overflow: hidden, the calendar is obviously cut off.
Setting overflow: visible;
to parent container became the solution in my case.
from v-calendar.
That is an interesting problem. Vue's component system does pose a little bit of a challenge. I may do some testing with vue-portal
to see if I can get things working. If I can, and if it doesn't add too much to the overall size of the package, I may include it as a dependency and add the option to alter the DOM hierarchy to overcome this issue.
from v-calendar.
There is an existing prop on v-date-picker
called popoverVisibility
for just this purpose. It accepts "hover"
, "focus"
, "visible"
and "hidden"
.
There are no events emitted though when the popover appears/disappears. That would be easy to add though.
from v-calendar.
Awesome, let me know if I can help in any way
from v-calendar.
One solution might be to allow the developer to specify a clear margin to apply whenever the popover is open. Then, when the popover is opened by the user, the margin is applied (probably around 200 - 300px. This would effectively force the model to display empty space inline, leaving room for the popover to display. This would probably be a better user experience as well.
from v-calendar.
I think I'm following what you're saying, do you mean that the height of the modal would change when the popover is open? One UX problem this poses for us is that the modal is vertically centered, so changing the modal height would make the inputs move up, potentially making the popover disappear again.
from v-calendar.
I see. Perhaps v-calendar
could force popover-visibility
to "focus"
instead of "hover"
, which I believe would solve this, but it might still be a little jarring to the user.
from v-calendar.
@nathanreyes Is that already an option? To control what event the popover responds to?
from v-calendar.
It would be nice to be able to control what events trigger the popover to open, also it would be nice to be able to have an event listener for the popover opening/closing. I think that would be a pretty simple way to use the workaround you suggested.
from v-calendar.
Hi @nickforddesign!
Were you able to solve this?
I've got the same issue https://codesandbox.io/s/o5joqz51x5
from v-calendar.
My modal had enough space on top of the datePicker; So I solved the problem temporarily by adding this line to the v-date-picker
:
popover-direction="top"
from v-calendar.
@nathanreyes no plans about usage with portal-vue?
from v-calendar.
Sorry to dig that issue up, but anyone has found a solution ? popover-direction="top"
doesn't wrk in my case.
from v-calendar.
i had this problem too, my modal need to scroll so i add overflow-y: auto to the parent container, but it seems not working when the parent container have overflow: hidden/auto as well, maybe we can conditinally set overflow parent container to "visible" when the v-calendar is open and back to "auto/hidden" when it close?
from v-calendar.
@nathanreyes 1646f74 there's prop: popoverShowClearMargin
but seems it doesn't work.
from v-calendar.
If a parent container has overflow: hidden, the calendar is obviously cut off.
Setting
overflow: visible;
to parent container became the solution in my case.
For me, the parent container was the .v-popper__inner class.
from v-calendar.
andersonAlmeida solution worked for me!
BTW, popover supports strategy = fixed
https://popper.js.org/docs/v2/constructors/#strategy
If v-calendar's PopoverConfig starts supporting strategy=fixed and pass that to popover, we will have clean solution.
Current PopoverConfig
type PopoverConfig = Partial<{
label: string;
customData: any;
visibility: 'click' | 'hover' | 'hover-focus' | 'focus';
placement: Placement;
hideIndicator: boolean;
isInteractive: boolean;
}>;
Future PopoverConfig
type PopoverConfig = Partial<{
label: string;
customData: any;
visibility: 'click' | 'hover' | 'hover-focus' | 'focus';
placement: Placement;
hideIndicator: boolean;
isInteractive: boolean;
strategy: 'fixed'|'';
}>;
If supported we can define
const popover = ref({
placement: 'top-start',
strategy: 'fixed',
})
<DatePicker
...
:popover="{
placement: 'top-start',
strategy: 'fixed',
}"
>
from v-calendar.
Related Issues (20)
- text instead of dots
- Boundless dates do not work in range mode
- floating-ui
- DatePicker: Incorrect dropdown arrow position when repositioning HOT 1
- Wrong type on DatePartsRuleFunction
- How to close popover after selecting today's button added inside popover
- "Space" or "Enter" key on header nav arrows results in duplicate nav action HOT 3
- DatePicker: cannot set `position: fixed` to popover's settings
- Calendar display only in-month days
- Incorrect locale month name
- CDN example from the v3 documents not working (PopperCore error) HOT 2
- Add custom slot to date picker popover
- DatePicker - Can't change selection on view programatically HOT 2
- Custom time picker HOT 1
- The "use from cdn" example in the v3 version is wrong HOT 2
- Prevent popover from hiding after day selection before time selection HOT 2
- Module 'v-calendar' should export types from utils package HOT 1
- Vue warn]: Duplicate keys found during update using multiple dots with same date HOT 1
- When click same date text filed is getting null value
- need help i want to chage year in the title to buddhistYear how can i do it
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 v-calendar.