Comments (4)
Oh another consideration is that I'd like to add offset support soon. So it would probably have to match
<sat-popover #p
horizontalAlign="after"
verticalAlign="above"
horizontalOffset="16"
verticalOffset="16">
<my-tooltip></my-tooltip>
</sat-popover>
vs. something like,
<sat-popover #p
xAlign="after"
yAlign="above"
xOffset="16"
yOffset="16">
<my-tooltip></my-tooltip>
</sat-popover>
or
<sat-popover #p
hAlign="after"
vAlign="above"
hOffset="16"
vOffset="16">
<my-tooltip></my-tooltip>
</sat-popover>
So this kind of makes me swing back towards providing an alias but keeping *Align
for both. It would probably be described in the docs to use horizontal|vertical
but with a note saying there is an x|y
shorthand.
from popover.
Thanks for separating the issue. My intention with aliases wasn't for smaller bundle, but for template cleanliness. It's personal preference, of course, but I like to break lines around 90-100 characters, so keeping input names as minimal as they can be while still being descriptive is important.
<!-- Proposed that both would be allowed and equal -->
<sat-popover #p hasBackdrop horizontalAlign="start" verticalAlign="below">
<sat-popover #p hasBackdrop xPos="start" yPos="below">
But I also see the point that having aliases can be confusing. And it's not like openTransition=""
or scrollStrategy=""
are particularly short. Plus, losing overlapAnchor
will save space anyway. I also like horizontalAlign
since it matches flexbox's align-items
.
I guess in conclusion, I like the proposal! I just want to chew on it a bit more before making the change.
from popover.
If we think the position we'll be set relative to another component, than align
makes more sense (two components will be aligned to each other in some way).
We can also think of h and v as an alternative to x and y. It is not so clear as horizontal and vertical, but it steps away from axis concepts.
from popover.
I've given this some thought and think it would be best to go with horizontalAlign
with xAlign
as an alias. The README would look like this
Positioning
By default, the popover will appear centered over the anchor. If you instead want the popover
to appear below the anchor:
<sat-popover #contactPopover verticalAlign="below">
<!-- ... -->
</sat-popover>
You can use the following to position the popover around the anchor:
Input | Type | Default |
---|---|---|
horizontalAlign |
'before' | 'start' | 'center' | 'end' | 'after' | 'center' |
verticalAlign |
'above' | 'start' | 'center' | 'end' | 'below' | 'center' |
For convenience, you can also use xAlign
and yAlign
as shorthand for horizontalAlign
and verticalAlign
, respectively.
from popover.
Related Issues (20)
- Sat-popover for open() is not working on ng build. With angular version 11 HOT 1
- Not able to scroll through the popover which is longer than WebPage's Height HOT 1
- Anchor Service is shared if used in a extended custom component
- 'afterClose' event is fired right after 'opened' event
- hasBackdrop error: Typescript - Type 'string' is not assignable to type 'boolean' HOT 1
- Cannot find popover.component.html when running tests with jest HOT 1
- Clickable content inside popover and hover trigger HOT 3
- Support Angular v13 HOT 5
- Dynamically add/remove backdropClass
- Module has no exports @ Angular 13 HOT 8
- Show one popover and hide other popovers HOT 1
- TypeScript Error: interactiveClose() - different type for get and set HOT 1
- Popover doesn't fit in browser viewport
- Support Angular v14
- Feature: Use Different Class Names For Start and End Alignments
- Preventing Trap Focus
- Allow configuring the FlexibleConnectedPositionStrategy
- Angular 15 was released HOT 13
- Error with angular 15.2.9 HOT 3
- Add country to leads api and improve the docs
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 popover.