Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Wrong arrow orientation/position #78

Open
stefanbruvik opened this issue May 18, 2016 · 10 comments
Open

Wrong arrow orientation/position #78

stefanbruvik opened this issue May 18, 2016 · 10 comments

Comments

@stefanbruvik
Copy link

Seems the arrow is pointing in the wrong direction. This happens whether orientation is set to auto or to something explicitly:

datepicker

Html output:
html

Now, if I manually edit this html in dev tools, and change datepicker-orient-bottom to datepicker-orient-top, the arrow points in the correct direction:

datepicker2

Setting the orientation explicitly to top left in my code, yields unwanted results, though:

datepicker3

@stefanbruvik stefanbruvik changed the title Wrong arrow orientation Wrong arrow orientation/position May 18, 2016
@prasannatm
Copy link

Same Issue when I try to use this inside bootstrap modal where also top is set to 0 instead of that particular input position top . Any fix to this would be great to continue using this plugin. Thanks 👍

@sergey-guk-dev
Copy link

I also encountered this problem.

@AlfaroLore
Copy link

I have the same issue

1 similar comment
@stephane-lapointe
Copy link

I have the same issue

@machinefriendly
Copy link

I have the same issue, I don't have a solution to correct that arrow direction, I just remove it by removing below-shown codes from the .css file, waiting for a final solution from others:
.datepicker-dropdown:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #999;
border-top: 0;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
}
.datepicker-dropdown:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-top: 0;
position: absolute;
}
.datepicker-dropdown.datepicker-orient-left:before {
left: 6px;
}
.datepicker-dropdown.datepicker-orient-left:after {
left: 7px;
}
.datepicker-dropdown.datepicker-orient-right:before {
right: 6px;
}
.datepicker-dropdown.datepicker-orient-right:after {
right: 7px;
}
.datepicker-dropdown.datepicker-orient-bottom:before {
top: -7px;
}
.datepicker-dropdown.datepicker-orient-bottom:after {
top: -6px;
}
.datepicker-dropdown.datepicker-orient-top:before {
bottom: -7px;
border-bottom: 0;
border-top: 7px solid #999;
}
.datepicker-dropdown.datepicker-orient-top:after {
bottom: -6px;
border-bottom: 0;
border-top: 6px solid #fff;
}

@joelklingler
Copy link

joelklingler commented Apr 24, 2017

@machinefriendly I have the same issue and remove the arrow as well. There is an easier way to achieve this without the need to modify the original CSS-file. Just add the following CSS and the arrow shouldn't be displayed anymore:

.datepicker-dropdown:after, .datepicker-dropdown:before { display: none !important; }

@joelklingler
Copy link

joelklingler commented Apr 24, 2017

I found a way to fix it without the need to modify any css.
I had the same issue as @stebru described. Using the datepicker-orient-top-class the arrow was pointing in the wrong direction. When I modified the html and replaced the class with datepicker-orient-bottom it worked as desired.

The following JS modifies the classes once the datepicker is shown:

$(document).on('show', $('.datepicker').datepicker(), function() {
  $('.datepicker').removeClass('datepicker-orient-top');
  $('.datepicker').addClass('datepicker-orient-bottom');
});

@FirstVertex
Copy link

I noticed this behavior when I updated my installation of Bootstrap Datepicker. I updated the .js file but forgot to also update the .css file. I had wrong arrow. Once I updated also the css file to latest version, my arrows work correctly now.

@voeurnchy
Copy link

The same issue, I fixed with this css

.datepicker-dropdown.datepicker-orient-bottom:before,
.datepicker-dropdown.datepicker-orient-bottom:after{
    transform: rotate(180deg);
    bottom: 100% !important;
}

@InaFK
Copy link

InaFK commented Jul 20, 2017

Cross-browser and for top orientation:
.datepicker-dropdown.datepicker-orient-bottom:before,
.datepicker-dropdown.datepicker-orient-bottom:after,
.datepicker-dropdown.datepicker-orient-top:before,
.datepicker-dropdown.datepicker-orient-top:after {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}

.datepicker-dropdown.datepicker-orient-bottom:before,
.datepicker-dropdown.datepicker-orient-bottom:after {
bottom: 100% !important;
}
.datepicker-dropdown.datepicker-orient-top:before,
.datepicker-dropdown.datepicker-orient-top:after {
top: 100% !important;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants